@@ 234-239 (lines=6) @@ | ||
231 | $xml->addChild('ttl', $this->ttl); |
|
232 | } |
|
233 | ||
234 | foreach ($this->items as $item) { |
|
235 | $toDom = dom_import_simplexml($xml); |
|
236 | $fromDom = dom_import_simplexml($item->asXML()); |
|
237 | $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); |
|
238 | } |
|
239 | ||
240 | return $xml; |
|
241 | } |
|
242 | } |
@@ 36-41 (lines=6) @@ | ||
33 | $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8" ?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">', |
|
34 | LIBXML_NOERROR | LIBXML_ERR_NONE | LIBXML_ERR_FATAL); |
|
35 | ||
36 | foreach ($this->channels as $channel) { |
|
37 | $toDom = dom_import_simplexml($xml); |
|
38 | $fromDom = dom_import_simplexml($channel->asXML()); |
|
39 | $toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true)); |
|
40 | } |
|
41 | ||
42 | $dom = new DOMDocument('1.0', 'UTF-8'); |
|
43 | $dom->appendChild($dom->importNode(dom_import_simplexml($xml), true)); |
|
44 | $dom->formatOutput = true; |