Subject: | XPath matching element values does not work |
The following code
use XML::DOM::Lite qw(Parser XPath);
my $xml_string1 = "<a><b value='foo'/><b value='bar'/></a>";
my $xml = Parser->parse($xml_string1);
print XPath->evaluate('count(/a/b[@value="foo"])', $xml);
Produces the output
2
As there is only one xml node with "value=foo", this should be returning
1.
It appears that selecting an attribute name does work, but filtering on
the value of that named attribute does not work.
Tested on RHEL6.0 amd64 with perl 5.10.1