public function testCreateFromDocbook()
 {
     $from = dirname(__FILE__) . '/files/docbook/xhtml/s_001_empty.xml';
     $to = dirname(__FILE__) . '/files/docbook/xhtml/s_001_empty.html';
     $docbook = new ezcDocumentDocbook();
     $docbook->loadFile($from);
     $document = new ezcDocumentXhtml();
     $document->createFromDocbook($docbook);
     // Store test file, to have something to compare on failure
     $tempDir = $this->createTempDir('docbook_xhtml_') . '/';
     file_put_contents($tempDir . basename($to), $xml = $document->save());
     $this->assertEquals(file_get_contents($to), $xml, 'Document not visited as expected.');
     // Remove tempdir, when nothing failed.
     $this->removeTempDir();
 }
Example #2
0
<?php

require 'tutorial_autoload.php';
$docbook = new ezcDocumentDocbook();
$docbook->loadFile('docbook.xml');
$html = new ezcDocumentXhtml();
$html->createFromDocbook($docbook);
echo $html->save();