/** * Handle a node * * Handle / transform a given node, and return the result of the * conversion. * * @param ezcDocumentElementVisitorConverter $converter * @param DOMElement $node * @param mixed $root * @return mixed */ public function handle(ezcDocumentElementVisitorConverter $converter, DOMElement $node, $root) { $citationContent = trim($converter->visitChildren($node, '')); $number = $converter->appendCitation($citationContent); // Add autonumbered citation reference $root .= sprintf('[CIT%03d]_ ', $number); return $root; }