Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: XML::LibXML count nodes

by Lotus1 (Chaplain)
on Nov 17, 2011 at 19:10 UTC ( #938668=note: print w/ replies, xml ) Need Help??


in reply to XML::LibXML count nodes

Try this:

print scalar(@{$doc->findnodes('//category')});

I've done it by assigning the nodes to an array and then just printing the number of elements in the array.


Comment on Re: XML::LibXML count nodes
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2015-05-05 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    In my home, the TV remote control is ...









    Results (120 votes), past polls