elgato has asked for the wisdom of the Perl Monks concerning the following question:
Hi.
It there any good way to get number of found nodes on xpath query?
Smth like this:
I just need nodes count without making foreach counter (have many rows). Thanks in advance.my $doc = $parser->parse_file($file); print length(@{$doc->findnodes('//category')})
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::LibXML count nodes
by choroba (Cardinal) on Nov 18, 2011 at 08:44 UTC | |
Re: XML::LibXML count nodes
by Anonymous Monk on Nov 17, 2011 at 15:27 UTC | |
by elgato (Novice) on Nov 17, 2011 at 15:43 UTC | |
Re: XML::LibXML count nodes
by Lotus1 (Vicar) on Nov 17, 2011 at 19:10 UTC |
Back to
Seekers of Perl Wisdom