in reply to large XML file in using XPATH
As alternative to XML::XPath, try XML::LibXML (XML::LibXML::XPathContext).
back to your problem, try this (not tested):my $xp = XML::XPath->new(filename=>$file); my $nodelist = $xp->find ('//w/a'); my %map; while (my $node = $nodelist->shift) { my $key = join ':', $node->getParentNode->getAttribute ('id'), $node->getAttribute ('name') ; push @{ $map{$key} }, $node; } for my $n (1 .. 32812) { my @wns = @{ $map{$n . ':' . 'wn'} || []); my @ls = @{ $map{$n . ':' . 'l'} || []); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: large XML file in using XPATH
by Anonymous Monk on Nov 05, 2009 at 16:47 UTC | |
by happy.barney (Friar) on Nov 06, 2009 at 06:36 UTC |