FW: [PHP] Re: Building an XML Parser Class

From: Date: Fri, 08 Aug 2003 14:38:45 +0000
Subject: FW: [PHP] Re: Building an XML Parser Class
Groups: php.general 
Request: Send a blank email to php-general+get-158842@lists.php.net to get a copy of this message
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:greg@chiaraquartet.net] Sent: Thursday, August 07, 2003 5:01 PM To: Donald Tyler Cc: php-general@lists.php.net 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

« previous php.general (#158842) next »