I've written a bit more code to test it out and it is very slow doing the findnodes when I'm already at a position in the tree.
I've written this test script:
my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($filename); my @devinfo = $doc->findnodes('//Device/Dev_Info'); foreach my $devinfo (@devinfo) { my($dev) = $devinfo->findnodes('./dev_name'); print $dev->to_literal, "\n"; }
The first findnodes runs very quickly (< 1 sec) but the one in the loop is a lot slower. But I don't know why. Doesn't it just have to examine the nodes "under" the current devinfo tag?
Am I doing something wrong with the findnodes call here?
Thanks, ~ Michael
In reply to Re^2: Any help available for a newbie to XML::LibXML?
by wardy3
in thread Any help available for a newbie to XML::LibXML?
by wardy3
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |