Subject: | getNodeText returns an XML::XPath::Literal and not a string |
Please clarify it in manpage.
Thank you very much
With next text you can see what I'm saying:
#!/usr/bin/perl
use strict;
use XML::XPath;
use Data::Dumper;
my $test;
my $xp = XML::XPath->new(ioref => *DATA);
my @nodes=$xp->findnodes('/A');
#for my $n ($root->get_nodelist)
for my $n (@nodes)
{
my $result=XML::XPath->new(context=>$n);
my $id=$result->getNodeText('@id')->value; # without -> value, dumper prints a Literal object
print Dumper $id,"\n";
}
__DATA__
<A id="a">
</A>