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:6
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joern_h at gmx dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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)
 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=32d49d33ad59add0db5c3bdb7221e67c65679953
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-2024 The PHP Group
All rights reserved.
Last updated: Tue Nov 26 22:01:33 2024 UTC