public static function replaceNodeContent($sContent, DOMNode $oNode) { DOMParser::emptyNodeContent($oNode); $oTMPContentDocument = new DOMDocument(); $oTMPContentDocument->loadXML('<root>' . $sContent . '</root>'); foreach ($oTMPContentDocument->firstChild->childNodes as $oChildNode) { $oInsertedNode = $oNode->ownerDocument->importNode($oChildNode, true); $oNode->appendChild($oInsertedNode); } }
protected function _render() { DOMParser::emptyNodeContent($this->_oNode); // TODO : use pubdate if member of article ! $this->_oNode->setAttribute('datetime', date(DATE_W3C, $this->datetime)); if (is_null(self::$_sLocale)) { $this->_setLocale(); } $this->_oNode->appendChild(new DOMText(strftime($this->format, $this->datetime))); }
protected function _render() { DOMParser::emptyNodeContent($this->_oNode); $this->_oNode->appendChild(new DOMText(str_replace('&', '&', $this->content))); }
protected function _render() { DOMParser::emptyNodeContent($this->_oNode); $this->_oNode->setAttribute('href', '/download/' . $this->ref . '/' . $this->file); $this->_oNode->appendChild(new DOMText(str_replace('&', '&', $this->label))); }