in reply to XML::Twig question

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; }

Replies are listed 'Best First'.
Re^2: XML::Twig question
by rjkoop (Initiate) on Dec 21, 2005 at 01:35 UTC
    That worked perfectly. Thanks.