You should probably use $doc->findvalue instead of findnodes because your XPath expression doesn't return a nodeset but boolean value.
warn $doc->findvalue('/root and /root/element1'), "\n"; warn $doc->findvalue('/root and /root/nosuch'), "\n";
yields:
true false
In reply to Re^3: XML::LibXML::XPathContext findnodes() Question
by roman
in thread XML::LibXML::XPathContext findnodes() Question
by AbrahamB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |