/** * Create document from docbook document * * A document of the docbook format is provided and the internal document * structure should be created out of this. * * 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. * * @param ezcDocumentDocbook $document * @return void */ public function createFromDocbook(ezcDocumentDocbook $document) { if ($this->options->validate && $document->validateString($document) !== true) { $this->triggerError(E_WARNING, "You try to convert an invalid docbook document. This may lead to invalid output."); } $this->path = $document->getPath(); $converter = new ezcDocumentDocbookToEzXmlConverter(); $converter->options->errorReporting = $this->options->errorReporting; $doc = $converter->convert($document); $this->document = $doc->getDomDocument(); }
/** * Create document from docbook document * * A document of the docbook format is provided and the internal document * structure should be created out of this. * * 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. * * @param ezcDocumentDocbook $document * @return void */ public function createFromDocbook(ezcDocumentDocbook $document) { if ($this->options->validate && $document->validateString($document) !== true) { $this->triggerError(E_WARNING, "You try to convert an invalid docbook document. This may lead to invalid output."); } $this->path = $document->getPath(); $this->options->driver->setOptions($this->options); $renderer = new ezcDocumentPdfMainRenderer($this->options->driver, $this->styles, $this->options); foreach ($this->pdfParts as $part) { $renderer->registerPdfPart($part); } $this->content = $renderer->render($document, $this->options->hyphenator, $this->options->tokenizer); // Merge errors from renderer $this->errors = array_merge($this->errors, $renderer->getErrors()); }