generateXML() public method

Generate the XML for a given element / sub-element.
public generateXML ( XMLWriter $XMLWriter ) : void
$XMLWriter XMLWriter
return void
コード例 #1
0
ファイル: Output.php プロジェクト: femotizo/Sitemap
 /**
  * @param OutputInterface $collection
  *
  * @return string
  */
 public function getOutput(OutputInterface $collection)
 {
     $xmlWriter = new XMLWriter();
     $xmlWriter->openMemory();
     $xmlWriter->startDocument('1.0', 'UTF-8');
     $xmlWriter->setIndent($this->isIndented());
     $xmlWriter->setIndentString($this->getIndentString());
     $collection->generateXML($xmlWriter);
     return trim($xmlWriter->flush(true));
 }
コード例 #2
0
ファイル: Output.php プロジェクト: thepixeldeveloper/sitemap
 /**
  * Renders the Sitemap as an XML string.
  *
  * @param OutputInterface $collection
  *
  * @return string
  */
 public function getOutput(OutputInterface $collection)
 {
     $xmlWriter = new XMLWriter();
     $xmlWriter->openMemory();
     $xmlWriter->setIndent($this->isIndented());
     $xmlWriter->startDocument('1.0', 'UTF-8');
     foreach ($this->processingInstructions as $target => $content) {
         $xmlWriter->writePi($target, $content);
     }
     $xmlWriter->setIndentString($this->getIndentString());
     $collection->generateXML($xmlWriter);
     return trim($xmlWriter->flush(true));
 }