return $tplInstance;
}
- /**
- * Renders the given image content
- *
- * @param $imageContent A valid XML image content
- * @return void
- * @throws XmlParserException If an XML error was found
- */
- public function renderImageContent ($imageContent) {
- // Get an XML parser
- $xmlParser = xml_parser_create();
-
- // Force case-folding to on
- xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
-
- // Set object
- xml_set_object($xmlParser, $this);
-
- // Set handler call-backs
- xml_set_element_handler($xmlParser, 'startElement', 'endElement');
- xml_set_character_data_handler($xmlParser, 'characterHandler');
-
- // Now parse the XML tree
- if (!xml_parse($xmlParser, $imageContent)) {
- // Error found in XML!
- throw new XmlParserException(array($this, $xmlParser), BaseHelper::EXCEPTION_XML_PARSER_ERROR);
- } // END - if
-
- // Free the parser
- xml_parser_free($xmlParser);
- }
-
/**
* Handles the start element of an XML resource
*
* @return void
* @throws XmlNodeMismatchException If current main node mismatches the closing one
*/
- public function endElement ($resource, $nodeName) {
+ protected function endElement ($resource, $nodeName) {
// Make all lower-case
$nodeName = strtolower($nodeName);
// Does this match with current main node?
//* DEBUG: */ echo "END: >".$nodeName."<<br />\n";
- if (($nodeName != $this->currMainNode) && (in_array($nodeName, $this->mainNodes))) {
+ if (($nodeName != $this->getCurrMainNode()) && (in_array($nodeName, $this->getMainNodes()))) {
// Did not match!
- throw new XmlNodeMismatchException (array($this, $nodeName, $this->currMainNode), BaseHelper::EXCEPTION_XML_NODE_MISMATCH);
- } elseif (in_array($nodeName, $this->subNodes)) {
+ throw new XmlNodeMismatchException (array($this, $nodeName, $this->getCurrMainNode()), BaseHelper::EXCEPTION_XML_NODE_MISMATCH);
+ } elseif (in_array($nodeName, $this->getSubNodes())) {
// Silently ignore sub nodes
return;
}
* @return void
* @todo Find something usefull with this!
*/
- public function characterHandler ($resource, $characters) {
+ protected function characterHandler ($resource, $characters) {
// Trim all spaces away
$characters = trim($characters);