Source: libxml-twig-perl Version: 1:3.44-1 As currently implemented, XML::Twig applies default namespaces also to all the unprefixed /attributes/ in scope, which is contrary to the specification [1]:
A default namespace declaration applies to all unprefixed element names within its scope. Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear. [1] http://www.w3.org/TR/xml-names/#defaulting Consider, for instance: $ perl -e 'use common::sense; require Data::Dump; require XML::Twig; binmode (\*STDOUT, ":encoding(utf8)") or die (); sub dump_atts { warn (scalar (Data::Dump::dump ($_->atts ())), "\n"); ## . 1; } my $xt = XML::Twig->new ("map_xmlns" => { qw (https://example.com/ns ns) }, "twig_handlers" => { "ns:bar" => \&dump_atts }) or die (); $xt->parse (("<foo xmlns=\"https://example.com/ns\">" . "<bar baz=\"qux\" /></foo>")) or die ();' { "ns:baz" => "qux" } $ The expected output is, however: { "baz" => "qux" } -- FSF associate member #7257 http://boycottsystemd.org/ … 3013 B6A0 230E 334A -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org