AbrahamB has asked for the wisdom of the Perl Monks concerning the following question:
test.xml:
Assuming I am using XML::LibXML correctly, does anyone have an idea why this returns expected result :<?xml version="1.0" encoding="UTF-8"?> <root> <element1>Element1 content</element1> <element2>Element2 content</element2> </root>
…But this returns empty array?my $xpath = ‘/root’; my $test = $doc->findnodes($xpath); print Dumper($test); $VAR1 = bless( [ bless( do{\(my $o = 13079328)}, 'XML::LibXML::Element +' ) ], 'XML::LibXML::NodeList' );
my $xpath = ’/root and /root/element1’; my $test = $doc->findnodes($xpath); print Dumper($test); $VAR1 = bless( [], 'XML::LibXML::NodeList' );
Back to
Seekers of Perl Wisdom