Re: Building an XML Parser Class
| From: | Evan Nemerson | Date: | Thu, 07 Aug 2003 21:35:41 +0000 |
| Subject: | Re: Building an XML Parser Class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158738@lists.php.net to get a copy of this message | ||
Try getting rid of the quotes around $this->startElement, or changing them to
double quotes.
If you don't understand why, php.net/language.types.string should make for an
exhilarating read :)
On Thursday 07 August 2003 12:40 pm, 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.
--
"Why be born again, when you can just grow up?"
-Unknown