Re: XML handlers in classes

From: Date: Fri, 25 Jul 2003 19:27:23 +0000
Subject: Re: XML handlers in classes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-156930@lists.php.net to get a copy of this message
If I remember well you can pass an array with object as the first element, function name as second: xml_set_element_handler($xml_parser, array($this,'startElement'),array($this,'endElement')); Robert Fitzpatrick wrote:
I have a class that receives an XML response from a HTTP request and I am trying to parse the XML after receiving it. The problem I'm having is the error when trying to use xml set handlers, such as 'xml_set_element_handler'. It seems the class is having trouble seeing the handler functions. For instance, if I set this: xml_set_element_handler($xml_parser, 'startElement','endElement'); Then I receive the error 'Unable to call handler startElement()', I tried to put $this-> in front of the names of the functions, but same thing. Can someone show me how to use these handlers in a class? -- Robert


« previous php.general (#156930) next »