ID: 30566 Updated by: [EMAIL PROTECTED] Reported By: joern_h at gmx dot net -Status: Open +Status: Closed Bug Type: XML related Operating System: Win 2000 PHP Version: 5.0.2 New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [2004-10-26 17:52:53] joern_h at gmx dot net Description: ------------ When parsing a document with multiple / default namespaces a wrong namespace can be reported. PHP 4.3.8 shows the right result. Reproduce code: --------------- <?php error_reporting(E_ALL); $xml = <<<HEREDOC <?xml version="1.0"?> <x xmlns="http://x/" xmlns:y="http://y/"> <y z="z" y:y="y" xmlns="http://a/" /> </x> HEREDOC; $p =& xml_parser_create_ns(null, "\n"); $vals = array(); $index = array(); xml_parser_set_option($p, XML_OPTION_SKIP_WHITE, true); xml_parser_set_option($p, XML_OPTION_CASE_FOLDING, false); if (!xml_parse_into_struct($p, $xml , $vals, $index)) { echo xml_error_string($p); } xml_parser_free($p); print_r($vals); ?> Expected result: ---------------- The attribute y:y should be in the http://y/ namespace, this is also the result when using PHP 4.3.8 Actual result: -------------- With PHP 5.02 the attribute y:y is in the http://a/ namespace. When the z attribute is removed the bug does not occur. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30566&edit=1