Subject: | XML::Stream::XPath fails to correctly find prefixed namespaces |
XML::Stream seems to incorrectly deal with namespace prefixes. In
particular, calling XPath('*[@xmlns]') on a parsed XML tree with only
prefixed namespaces returns an empty list, as demonstrated by the code
below.
use XML::Stream qw(Node);
use Data::Dumper;
my $p = XML::Stream::Parser->new(style => "node");
my $node1 = $p->parse("<foo><baz xmlns='qux'/></foo>");
my @path1 = $node1->XPath('*[@xmlns]');
print "node1: " . Dumper($node1);
print "path1: " . Dumper(@path1);
my $p2 = XML::Stream::Parser->new(style => "node");
my $node2 = $p2->parse("<foo><bar:baz xmlns:bar='qux'/></foo>");
my @path2 = $node2->XPath('*[@xmlns]');
print "node2: " . Dumper($node2);
print "path2: " . Dumper(@path2);
1;
I'm running perl, v5.10.0 on Linux 2.6.26-2-686-bigmem.