28 if (!defined(
'DATE_W3C')) {
29 define(
'DATE_W3C',
'Y-m-d\TH:i:sP');
64 public function __construct($pTemporaryStorage = self::STORAGE_MEMORY, $pTemporaryStorageFolder =
'./') {
69 if ($pTemporaryStorage == self::STORAGE_MEMORY) {
70 $this->_xmlWriter->openMemory();
73 $this->_tempFileName = @tempnam($pTemporaryStorageFolder,
'xml');
76 if ($this->_xmlWriter->openUri($this->_tempFileName) ===
false) {
78 $this->_xmlWriter->openMemory();
83 $this->_xmlWriter->setIndent(
true);
91 unset($this->_xmlWriter);
94 if ($this->_tempFileName !=
'') {
95 @unlink($this->_tempFileName);
105 if ($this->_tempFileName ==
'') {
106 return $this->_xmlWriter->outputMemory(
true);
108 $this->_xmlWriter->flush();
109 return file_get_contents($this->_tempFileName);
119 public function __call($function, $args) {
121 @call_user_func_array(array($this->_xmlWriter, $function), $args);
135 if (isset($this->_xmlWriter) && is_object($this->_xmlWriter) && (method_exists($this->_xmlWriter,
'writeRaw'))) {
136 return $this->_xmlWriter->writeRaw(htmlspecialchars($text));
139 return $this->text($text);