From:             david dot seidel at one-jinx dot de
Operating system: Linux (2.4.19)
PHP version:      5CVS-2004-04-06 (dev)
PHP Bug Type:     XML related
Bug description:  xml_set_object(...) seems to not working

Description:
------------
If written a class that uses xml_set_object(...). In PHP5.0.0RC1 this
works correctly, but in PHP Version 5.0.0RC2-dev (php5-200404060630) my
script produces a lot of warnings like "Warning: xml_parse()
[function.xml-parse]: Unable to call handler tag_open() in ...". When I
use function instead of the methods, everything seems to work correctly.

Reproduce code:
---------------
class blwTemplateEngine

...

public function __construct(...) {

$this->parser = xml_parser_create();

xml_set_object($this->parser, $this);

xml_set_element_handler($this->parser, "tag_open", "tag_close");

xml_set_character_data_handler($this->parser, "cdata");

$this->setOption(XML_OPTION_CASE_FOLDING, false);

}

...

protected final function tag_open($parser, $tag, $attributes) {}

protected final function tag_close($parser, $tag) {}

protected final function cdata($parser, $cdata) {}

...

}



Expected result:
----------------
render a Template

Actual result:
--------------
Warning: xml_parse() [function.xml-parse]: Unable to call handler cdata()
in
/srv/www/htdocs/bluewonder_neo/bluewonder/base/template/blwTemplateEngine.php
on line 156



line 156:

if(!xml_parse($this->parser, $data)) {

                        throw new Exception("XML-Parser-Error: Error in 
".$this->templatePath."
- ".xml_error_string(xml_get_error_code($this->parser)). " (Error-Code:
".xml_get_error_code($this->parser).") at line
".xml_get_current_line_number($this->parser)." and column
".xml_get_current_column_number($this->parser));

                }





-- 
Edit bug report at http://bugs.php.net/?id=27882&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27882&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27882&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27882&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27882&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27882&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27882&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27882&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27882&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27882&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27882&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27882&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27882&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27882&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27882&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27882&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27882&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27882&r=float

Reply via email to