X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fclasses%2Fmain%2Fdecorator%2Ftemplate%2Fclass_XmlRewriterTemplateDecorator.php;h=c849ef1351eb9f746ccc25d36086179d7ff09eba;hb=0b0228ee8e795d5bd429449eeefcef27730c895e;hp=90126f8fd02a264ad204806ff4de84cf6e1301eb;hpb=43deb129f6e8a12c37f0df17ad0870d3491bdd34;p=core.git diff --git a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php index 90126f8f..c849ef13 100644 --- a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php +++ b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php @@ -5,7 +5,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -389,6 +389,56 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT // Call the inner class' method return $this->getTemplateInstance()->isXmlCompactingEnabled(); } + + /** + * Handles the start element of an XML resource + * + * @param $resource XML parser resource (currently ignored) + * @param $element The element we shall handle + * @param $attributes All attributes + * @return void + * @throws InvalidXmlNodeException If an unknown/invalid XML node name was found + */ + public function startElement ($resource, $element, array $attributes) { + // Call the inner class' method + $this->getTemplateInstance()->startElement($resource, $element, $attributes); + } + + /** + * Ends the main or sub node by sending out the gathered data + * + * @param $resource An XML resource pointer (currently ignored) + * @param $nodeName Name of the node we want to finish + * @return void + * @throws XmlNodeMismatchException If current main node mismatches the closing one + */ + public function endElement ($resource, $nodeName) { + // Call the inner class' method + $this->getTemplateInstance()->endElement($resource, $nodeName); + } + + /** + * Currently not used + * + * @param $resource XML parser resource (currently ignored) + * @param $characters Characters to handle + * @return void + * @todo Find something useful with this! + */ + public function characterHandler ($resource, $characters) { + // Call the inner class' method but trim the characters before + $this->getTemplateInstance()->characterHandler($resource, trim($characters)); + } + + /** + * Removes all comments, tabs and new-line charcters to compact the content + * + * @param $content The uncompacted content + * @return $content The compacted content + */ + public function compactContent ($content) { + $this->getTemplateInstance()->compactContent($content); + } } // [EOF]