Thanks for the link. Sadly it doesn't really apply to what I am trying to do. My class literally translates the Xml Document into an associative array.
PHP's functionality for working with XML documents is way too limited for me to do what I need to while still keeping my code legible. That's why I am changing it into an array first. As I said, the code works perfect. All I need to do is to be able to call a method of the parent of the Xml Parser. I presume the Xml Parser is an object even though it is created with $MyXmlParser = xml_parser_create(); Instead of say: $MyXmlParser = new XmlParser; -----Original Message----- From: Greg Beaver [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 5:01 PM To: Donald Tyler Cc: [EMAIL PROTECTED] Subject: [PHP] Re: Building an XML Parser Class http://pear.php.net/XML_Parser :) Greg -- phpDocumentor http://www.phpdoc.org Donald Tyler wrote: > Hi, > > I am trying to create a Class that will parse an XML document. It all works > fine as individual functions but I cant get it to work as a class. > > For example, when I do the following in my class: > > 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. > > Does anyone know a good way around this? > > > Thanks. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php