php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30061 xml_set_start_namespace_decl_handler not called
Submitted: 2004-09-11 00:06 UTC Modified: 2004-11-18 21:17 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jw at jwscripts dot com Assigned:
Status: Closed Package: XML related
PHP Version: 5.0.2 OS: Windows XP
Private report: No CVE-ID: None
 [2004-09-11 00:06 UTC] 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-11 00:14 UTC] jw at jwscripts dot com
This bug seems to be related to bug #27908
 [2004-09-25 13:26 UTC] jw at jwscripts dot com
Problem persists in version 5.0.2
 [2004-11-18 21:17 UTC] rrichards@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC