http://www.perlmonks.org?node_id=986048


in reply to Re: XML-Twig: more efficient tree processing
in thread XML-Twig: more efficient tree processing

Here's the nutshell version of what the code does:

my $twig = new XML::Twig ( TwigRoots => { 'tables/table' => \&processColum +ns, 'views/view' => \&processColumns + } ); $twig->parsefile($SCHEMAS); $twig->dispose; sub processColumns () { my( $twig, $tableTwig ) = @_; my @colList = $tableTwig->find_nodes ("columns/column"); foreach $x (@colList) { blah; } }