Skip Menu |

This queue is for tickets about the XML-Parser-Lite-Tree-XPath CPAN distribution.

Report information
The Basics
Id: 56041
Status: new
Priority: 0/
Queue: XML-Parser-Lite-Tree-XPath

People
Owner: Nobody in particular
Requestors: SSEVERIN [...] cpan.org
Cc: sns-perl [...] severinghaus.org
AdminCc:

Bug Information
Severity: Important
Broken in: 0.24
Fixed in: (no value)



CC: sns-perl [...] severinghaus.org
Subject: select_nodes only returns one node even when many match
I hope I'm not just having a late-night brain problem. I'm using select_nodes on a tree generated through Flickr::API that is very much like the example given here: http://www.flickr.com/services/api/flickr.photos.getInfo.html I'm wanting a list of all of the tags. With $tree as my tree of this <photo> document, I do: my $xpath = new XML::Parser::Lite::Tree::XPath($tree); my @tags = $xpath->select_nodes('/photo/tags/tag'); But scalar(@tags) == 1 no matter how many tags are present (assuming any are present). The same result is returned for select_nodes('/photo/ tags/*') or just '//tag'. I can just do select_nodes('/photo/tags') and then loop over the children, but that seems to defeat the purpose of using XPath. It seems like a big enough problem that I must be doing something wrong, but I cannot seem to figure out what. If any more info or testing would be useful, please let me know. Cheers, -Steve