|  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
Avg. Score:4.2 ± 1.5
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:2 (40.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: None
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
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:

$xml = '<addressbook xmlns:ab="" />';

$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);

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-19 12:58 UTC]
NS end event is not supported under libxml.
 [2010-10-19 06:58 UTC]
Automatic comment from SVN on behalf of kalle
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-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 21 02:01:23 2020 UTC