I think the $twig->purge is a little too strong for what you are doing. It seems to interfere with the way the twig is stored. Using $element->delete instead when the element is not one you want to output would work better.
I will investigate some more to understand better what's going on, but in the mean time a handler like this seems to work:
sub parseEntry { my ($twig,$element)=@_; my $id=$element->att("id"); if ($id eq "OVAL3") { $twig->flush(); return 1; } else { $element->delete; } return 0; }
In reply to Re: XML::Twig question
by mirod
in thread XML::Twig question
by rjkoop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |