/** * Transform directive to docbook * * Create a docbook XML structure at the directives position in the * document. * * @param DOMDocument $document * @param DOMElement $root * @return void */ public function toDocbook(DOMDocument $document, DOMElement $root) { parent::toDocbook($document, $root); $text = ''; foreach ($this->node->nodes as $node) { $text .= $node->token->content; } $text = trim($text); if (!empty($text)) { $media = $root->getElementsBytagName('mediaobject')->item(0); $caption = $document->createElement('caption'); $media->appendChild($caption); $paragraph = $document->createElement('para', htmlspecialchars($text)); $caption->appendChild($paragraph); } }
/** * Converts the Image directive to aDocBook image tag. * * This method takes an image directive and converts it into its DocBook representation and stores a reference in * the Asset manager of the Converter. * * @see ConverterInterface::getAssets() for the asset manager * * @param \DOMDocument $document * @param \DOMElement $root * * @return void */ public function toDocbook(\DOMDocument $document, \DOMElement $root) { $this->storeAsset(); parent::toDocbook($document, $root); }