in reply to parsing xml
use warnings; use strict; use XML::Twig; my $xmlstr = <<EOF; <top> <COMPLETE> <T>test</T> <L>light</L> <INFO>information</INFO> </COMPLETE> <COMPLETE> <T>test</T> <L>light</L> <INFO>informa</INFO> </COMPLETE> </top> EOF my $twig = XML::Twig->new( twig_handlers => {INFO => sub {$_->delete()}}, pretty_print => 'indented' ); $twig->parse($xmlstr); $twig->print(); __END__ <top> <COMPLETE> <T>test</T> <L>light</L> </COMPLETE> <COMPLETE> <T>test</T> <L>light</L> </COMPLETE> </top>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: parsing xml
by mirod (Canon) on Apr 07, 2011 at 07:37 UTC |