Namespace Handler isn't called

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I'm using the XML functions in PHP 5.  The callback function I set for
namespace declarations doesn't get called.  Can anyone help me out?
The code is:

$xml = '<addressbook
xmlns:ab=" /">' .
$parser = xml_parser_create_ns();

xml_set_element_handler( $parser, 'StartHandler', 'EndHandler' );

/* The handler doesn't get called for some reason */
xml_set_start_namespace_decl_handler( $parser, 'NSHandler' );

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/>' );

And the output is:

StartHandler Called
EndHandler Called

I want the output to be

StartHandler Called
EndHandler Called
NSHandler Called


Site Timeline