Yes, though you'll most probably want to process a whole twig, not just the individual leafs. Without more details about the XML it's impossible to be more specific.
Another contender would be XML::Rules. With the right handlers it can process huge files easily.
Update: I do not use XML::Twig myself. This is an example of what you could do with XML::Rules:
use strict; use XML::Rules; my $parser = XML::Rules->new( stripspaces => 7, rules => { _default => 'content', Book => sub { my ($tag,$attr) = @_; if (!$attr->{Title}) { return; }# no title, OK. ignore print "$attr->{Title} by $attr->{Author} was released $att +r->{Released}\n"; return; }, }, ); $parser->parse(\*DATA); # or $parser->parsefile('path/to/the/file');
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re: Parsing a huge XML document recursively
by Jenda
in thread Is it possible to parse an XML file recursively using XML::Twig?
by Ppeoc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |