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.
In reply to Re: XML::LibXML count nodes
by Lotus1
in thread XML::LibXML count nodes
by elgato
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |