/** * Return document compiled to the docbook format * * The internal document structure is compiled to the docbook format and * the resulting docbook document is returned. * * This method is required for all formats to have one central format, so * that each format can be compiled into each other format using docbook as * an intermediate format. * * You may of course just call an existing converter for this conversion. * * @return ezcDocumentDocbook */ public function getAsDocbook() { $tokenizer = $this->options->tokenizer; $parser = new ezcDocumentWikiParser(); $parser->options->errorReporting = $this->options->errorReporting; $this->ast = $parser->parse($tokenizer->tokenizeString($this->contents)); $document = new ezcDocumentDocbook(); $visitor = new ezcDocumentWikiDocbookVisitor($this, $this->path); $document->setDomDocument($visitor->visit($this->ast, $this->path)); $document->setPath($this->path); // Merge errors from converter $this->errors = array_merge($this->errors, $parser->getErrors(), $visitor->getErrors()); return $document; }
/** * Return document compiled to the docbook format * * The internal document structure is compiled to the docbook format and * the resulting docbook document is returned. * * This method is required for all formats to have one central format, so * that each format can be compiled into each other format using docbook as * an intermediate format. * * You may of course just call an existing converter for this conversion. * * @return ezcDocumentDocbook */ public function getAsDocbook() { foreach ($this->filters as $filter) { $filter->filter($this->document); } $docbook = new ezcDocumentDocbook(); $docbook->setDomDocument($this->buildDocbookDocument($this->document)); $docbook->setPath($this->path); return $docbook; }