_container->getEncoding()) { $this->_container->setEncoding('UTF-8'); } $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding()); $this->_dom->formatOutput = true; $root = $this->_dom->createElement('source'); $this->setRootElement($root); $this->_dom->appendChild($root); $this->_setLanguage($this->_dom, $root); $this->_setBaseUrl($this->_dom, $root); $this->_setTitle($this->_dom, $root); $this->_setDescription($this->_dom, $root); $this->_setDateCreated($this->_dom, $root); $this->_setDateModified($this->_dom, $root); $this->_setGenerator($this->_dom, $root); $this->_setLink($this->_dom, $root); $this->_setFeedLinks($this->_dom, $root); $this->_setId($this->_dom, $root); $this->_setAuthors($this->_dom, $root); $this->_setCopyright($this->_dom, $root); $this->_setCategories($this->_dom, $root); foreach ($this->_extensions as $ext) { $ext->setType($this->getType()); $ext->setRootElement($this->getRootElement()); $ext->setDomDocument($this->getDomDocument(), $root); $ext->render(); } return $this; } /** * Set feed generator string * * @param DOMDocument $dom * @param DOMElement $root * @return void */ protected function _setGenerator(DOMDocument $dom, DOMElement $root) { if(!$this->getDataContainer()->getGenerator()) { return; } $gdata = $this->getDataContainer()->getGenerator(); $generator = $dom->createElement('generator'); $root->appendChild($generator); $text = $dom->createTextNode($gdata['name']); $generator->appendChild($text); if (array_key_exists('uri', $gdata)) { $generator->setAttribute('uri', $gdata['uri']); } if (array_key_exists('version', $gdata)) { $generator->setAttribute('version', $gdata['version']); } } }