php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30834 Namespace end handler is not called
Submitted: 2004-11-19 11:54 UTC Modified: 2004-11-19 12:58 UTC
Votes:5
Avg. Score:4.0 ± 1.5
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: joern_h at gmx dot net Assigned:
Status: Wont fix Package: XML related
PHP Version: 5CVS-2004-11-19 (dev) OS: Windows 2000
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-11-19 11:54 UTC] joern_h at gmx dot net
Description:
------------
When registering a function with xml_set_end_namespace_decl_handler this function is never called. This is very similar to Bug #30061 "xml_set_start_namespace_decl_handler not called" which is now closed.

Reproduce code:
---------------
<?php

$xml = '<addressbook xmlns:ab="http://www.somewhere.com/addressbook/" />';

$parser =& xml_parser_create_ns();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);

xml_set_start_namespace_decl_handler($parser, "NSStartHandler");
xml_set_end_namespace_decl_handler($parser, "NSEndHandler");

xml_set_element_handler($parser, 'StartHandler', 'EndHandler');
xml_parse($parser, $xml, true);
xml_parser_free($parser);

function StartHandler($parser, $name, $attrs) {print("StartHandler Called\n");}
function EndHandler($parser, $name) {print("EndHandler Called\n");}
function NSStartHandler($parser, $prefix, $uri) {print("NSStartHandler Called\n");}
function NSEndHandler($parser, $prefix) {print("NSEndHandler Called\n");}

?>


Expected result:
----------------
NSStartHandler Called
StartHandler Called
EndHandler Called
NSEndHandler Called

Actual result:
--------------
NSStartHandler Called
StartHandler Called
EndHandler Called

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-19 12:58 UTC] rrichards@php.net
NS end event is not supported under libxml.
 [2010-10-19 06:58 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=304501
Log: * Fixed #52089 (missing xml_set_start/end_namespace_decl_handler)
* Added remark about xml_set_end_namespace_decl_handler() -- Fixes #30834 (Namespace end handler is not called)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 06:02:13 2014 UTC