#30061 [Opn->Csd]: xml_set_start_namespace_decl_handler not called
| From: | rrichards@php.net | Date: | Thu, 18 Nov 2004 20:17:30 +0000 |
| Subject: | #30061 [Opn->Csd]: xml_set_start_namespace_decl_handler not called | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69232@lists.php.net to get a copy of this message | ||
ID: 30061
Updated by: rrichards@php.net
Reported By: jw at jwscripts dot com
-Status: Open
+Status: Closed
Bug Type: XML related
Operating System: Windows XP
PHP Version: 5.0.2
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-09-25 13:26:09] jw at jwscripts dot com
Problem persists in version 5.0.2
------------------------------------------------------------------------
[2004-09-11 00:14:28] jw at jwscripts dot com
This bug seems to be related to bug #27908
------------------------------------------------------------------------
[2004-09-11 00:06:41] jw at jwscripts dot com
Description:
------------
The namespace handler defined with the
xml_set_start_namespace_decl_handler() function is never called.
Reproduce code:
---------------
<?
$xml = '<addressbook xmlns:ab="http://www.somewhere.com/addressbook/"
/>';
$parser = xml_parser_create_ns();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
/* The handler doesn't get called for some reason */
xml_set_start_namespace_decl_handler( $parser, "NSHandler" );
xml_set_element_handler( $parser, 'StartHandler', 'EndHandler' );
xml_parse( $parser, $xml, true);
xml_parser_free( $parser );
function StartHandler( $parser, $name, $attrs ) {
print( "StartHandler Called<br/>" );
}
function EndHandler( $parser, $name ) {
print( 'EndHandler Called<br/>' );
}
function NSHandler( $parser, $prefix, $uri ) {
print( 'NSHandler Called<br/>' );
}
function DefaultHandler( $parser, $data ) {
print( 'DefaultHandler Called<br/>' );
}
?>
Expected result:
----------------
NSHandler Called
StartHandler Called
EndHandler Called
Actual result:
--------------
StartHandler Called
EndHandler Called
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30061&edit=1