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' );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::LibXML::XPathContext findnodes() Question
by Anonymous Monk on Dec 19, 2008 at 16:33 UTC | |
Re: XML::LibXML::XPathContext findnodes() Question
by runrig (Abbot) on Dec 19, 2008 at 19:34 UTC | |
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 |
Back to
Seekers of Perl Wisdom