RE: [PHP] Building an XML Parser Class

From: Date: Fri, 08 Aug 2003 15:25:41 +0000
Subject: RE: [PHP] Building an XML Parser Class
Groups: php.general 
Request: Send a blank email to php-general+get-158860@lists.php.net to get a copy of this message
Three ways I tried using the :: syntax: 1. With either double OR single and with OR without () (Tried all 4 combinations) quotes: xml_set_element_handler($this->xml_parser, "xmlTranslator::startElement", "xmlTranslator::endElement"); Gives me the following error message: Warning: xml_parse(): Unable to call handler xmlTranslator::startElement() in c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on line 90 2. With no quotes: xml_set_element_handler($this->xml_parser, xmlTranslator::startElement(), xmlTranslator::endElement()); This runs the functions, but doesn't pass any parameters to it. All I get are missing parameter error messages. -----Original Message----- From: Donald Tyler [mailto:dtyler@frazerbilt.com] Sent: Friday, August 08, 2003 9:11 AM To: 'php-general@lists.php.net' Subject: RE: [PHP] Building an XML Parser Class I did read the other thread, and I tried that. It didn't work... -----Original Message----- From: Jay Blanchard [mailto:jay.blanchard@niicommunications.com] Sent: Thursday, August 07, 2003 2:46 PM To: Donald Tyler; php-general@lists.php.net Subject: RE: [PHP] Building an XML Parser Class [snip] xml_set_element_handler($this->xml_parser, '$this->startElement', "$this->endElement"); xml_set_character_data_handler($this->xml_parser, "$this->valueHandler"); I get an error message: Warning: xml_parse(): Unable to call handler $this->startElement() in c:\program files\apache group\php\My_includes\Class.xmlTranslator.php on line 90 Now I presume this is because I am trying to call methods of my class. [/snip] Hmmm... I thought you might have read the other class thread. Since the method is not public you could call it with the :: syntax. http://www.php.net/manual/en/keyword.paamayim-nekudotayim.php HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#158860) next »