public function viewAction($path) { $doc = $this->getSource($path); $document = new ezcDocumentConfluenceWiki(); $document->options->errorReporting = E_PARSE | E_ERROR | E_WARNING; $document->loadString($doc); $docbook = $document->getAsDocbook(); $converter = new ezcDocumentDocbookToHtmlConverter(); $converter->options->styleSheet = null; // Add custom CSS style sheets $converter->options->styleSheets = array('/styles/screen.css'); $html = $converter->convert($docbook); $xml = $html->save(); $doc = new DOMDocument(); $doc->loadXML($xml); $xp = new DOMXPath($doc); $xp->registerNamespace("xhtml", "http://www.w3.org/1999/xhtml"); $res = $xp->query("/xhtml:html/xhtml:body/node()"); $html = ""; foreach ($res as $node) { $html .= $doc->saveXML($node); } $html .= '<div id="action"><a href="?action=edit" accesskey="e">Edit</a></div>'; return $html; }
public function testReadConfluenceDocument() { $wiki = new ezcDocumentConfluenceWiki(); $wiki->loadFile(dirname(__FILE__) . '/files/wiki/confluence/s_002_inline_markup.txt'); $docbook = $wiki->getAsDocbook(); $this->assertEquals(file_get_contents(dirname(__FILE__) . '/files/wiki/confluence/s_002_inline_markup.xml'), $docbook->save(), 'Document not visited as expected.'); }