Bug #71595 [Opn->Ana]: NS end handler is never called
| From: | ab@php.net | Date: | Tue, 16 Feb 2016 16:08:05 +0000 |
| Subject: | Bug #71595 [Opn->Ana]: NS end handler is never called | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199265@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71595&edit=1
ID: 71595
Updated by: ab@php.net
Reported by: anrdaemon at freemail dot ru
Summary: NS end handler is never called
-Status: Open
+Status: Analyzed
Type: Bug
Package: XML related
Operating System: Windows
PHP Version: 5.6.18
Block user comment: N
Private report: N
New Comment:
Thanks for the reports. How it looks like, the things you've realized do happen most likely not
due to a PHP bug, but depend on the libxml2 usage. libxml doesn't support all the available
callbacks, and it's documented. From a quick look, have to check deeper, the other tickets
you've reported have the same cause. Many Linux distros link with libxml, as well it's
used on Windows.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2016-02-15 02:38:31] anrdaemon at freemail dot ru
Description:
------------
When NS-aware parser is created, the handler set by xml_set_end_namespace_decl_handler() is never
called.
Test script:
---------------
<?php
$indent = '';
$parser = xml_parser_create_ns('UTF-8');
xml_set_end_namespace_decl_handler($parser, function($self, $name)
{
global $indent;
$ns = $name ?: '(default)';
print $indent . "/NS:{$ns}\n";
});
// Expecting at least one mention of /NS: ...
xml_parse($parser, '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE shape PUBLIC "-//Dia//DTD Dia shape 1.0//EN" "http://www.daa.com.au/~james/dia-shape-ns">
<shape>
<svg xmlns:svg="http://www.w3.org/2000/svg"
svg:width="300px" svg:height="300px" svg:viewBox="0 0 3 3">
<svg:circle svg:style="fill: yellow;" cx="1.5" cy="1.5"
r="0.5"/>
</svg>
</shape>', true);
print xml_error_string(xml_get_error_code($parser)) . "\n";
?>
Expected result:
----------------
Expecting at least one mention of "/NS:...".
Especially one, where parser leaving the enclosed SVG structure.
Actual result:
--------------
No error
(No really, there's no error. But... Where's my handlers?)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71595&edit=1