Untested, but should be pretty close to working:
XML::Twig->new( twig_handlers => { Fruit => sub { $_->cut unless( $col +or{$_->att( 'name')}); } } ) ->parsefile( "fruits.xml");
If memory is a problem, flush the twig at the end of the handler and after the parse.
In reply to Re: Validate XML based on hash data structure
by mirod
in thread Validate XML based on hash data structure
by ramya2005
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |