in reply to XML::LibXML::XPathContext findnodes() Question
How can you be at both /root and /root/element1 at the same time (and I'm not even sure that 'and' can be used even that way)? Do you mean?:my $xpath = ’/root and /root/element1’;
Anyway, in your first case, it returns a NodeList object (which will contain no nodes), and in the second case, it returns an empty list (if there were nodes, it would return a list of Node objects)...due to the difference in the scalar vs. list context behavior of findnodes(), as implied in the post above.my $xpath = ’/root | /root/element1’;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: XML::LibXML::XPathContext findnodes() Question
by AbrahamB (Initiate) on Dec 19, 2008 at 20:54 UTC | |
by runrig (Abbot) on Dec 19, 2008 at 23:31 UTC | |
by roman (Monk) on Dec 20, 2008 at 10:00 UTC |
In Section
Seekers of Perl Wisdom