Re: Re: xpath problem with XML::XPath and LibXML
by redicaps other posts by this author
Jun 22 2009 12:11AM messages near this date
view in the new Beta List Site
Re: xpath problem with XML::XPath and LibXML
|
Re: xpath problem with XML::XPath and LibXML
& XSLT Thanks.
I got another question
when we use LibXML findvalue sub
eg.
$values = $node-> findvalue($xpath);
It will return all the nodes' value as a string. Can it LibXML return an
array or an array ref?
On Jun 21, 2009 10:38pm, Aristotle Pagaltzis <pagaltzis@[...].de> wrote:
> * redicaps@[...].com redicaps@[...].com> [2009-06-21 12:50]:
> > Here is the XML::XPath code:
> >
> > my $xml = XML::XPath->new( xml => $string);
> > my $nodeset = $xml->findnodes('//entry');
> > foreach my $node ( $nodeset->get_nodelist){
> > print $node->findvalue('//title'),"\n";
> > }
> >
> > I got
> > friendsEngowo
> > friendsEngowo
> > which are all the title nodes of this xml, it seems like each
> > $node has all the information of this XML. Dose any one knows
> > what the problem is?
> XML::XPath is buggy. It shouldn't produce any output for your
> expession.
> > Then I try to use XML::LibXML instead, here is the code
> >
> > my $xml = XML::LibXML->new->parse_string( $string);
> > my @nodeset = $xml->find('//entry');
> > print Dumper @nodeset;
> >
> > I got
> > $VAR1 = bless( [], 'XML::LibXML::NodeList' );
> >
> > which means I got nothing, entry nodes for this xml are not
> > found, so can anybody help me?
> This is correct behaviour. Bj�rn told you the solution; see
> http://plasmasturm.org/log/259/> for some more background and
> some example code.
> Regards,
> --
> Aristotle Pagaltzis // http://plasmasturm.org/>
> _______________________________________________
> Perl-XML mailing list
> Perl-XML@[...].com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
redicaps
Aristotle Pagaltzis
redicaps
Shlomi Fish
Michael Ludwig
redicaps
Grant McLean
Bjoern Hoehrmann
|