]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php
Some code-cosmetics applied:
[core.git] / inc / classes / main / decorator / template / class_XmlRewriterTemplateDecorator.php
index 90126f8fd02a264ad204806ff4de84cf6e1301eb..2cddb8cfe4eb0c41d730110cae7f5cfd33c0f0ce 100644 (file)
@@ -5,7 +5,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @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,60 @@ 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       $uncompactedContent             The uncompacted content
+        * @return      $compactedContent               The compacted content
+        */
+       public function compactContent ($uncompactedContent) {
+               // Compact it ...
+               $compactedContent = $this->getTemplateInstance()->compactContent($uncompactedContent);
+
+               // ... and return it
+               return $compactedContent;
+       }
 }
 
 // [EOF]