|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-01-20 14:33 UTC] schst@php.net
Description: ------------ If using xml_set_object() to register handlers in an object, xml_parse sometimes looses the reference to the object and displays a warning: Warning: xml_parse() [function.xml-parse]: Unable to call handler startHandler() in C:\php4\PEAR\XML\Parser.php on line 264 Try PEAR::XML_RDDL to see the bug in action. If registering xml_set_element_handler( $p, array( $obj, 'method' ), array( $obj, 'method' ) ) it seems to work fine. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
here is an example: class test { function startElement($a, $b, $c) { print "start"; } function endElement($a, $b) { print "end"; } function characterData($a, $b) { print $b; } function parse() { $parser = xml_parser_create(); xml_set_object($parser, &$this); xml_set_element_handler($parser, "startElement", "endElement"); xml_set_character_data_handler($parser, "characterData"); xml_parse($parser); } } $a = new test; $a->parse();