in reply to Re: Parse with XML::Simple: how to keep some tags "unparsed"?
in thread Parse with XML::Simple: how to keep some tags "unparsed"?
use XML::Twig; my $xml = '<?xml version="1.0" ?> <page id="1"> <content> This is <div class="red">some HTML text</div> </content> </page>'; my $twig = XML::Twig->new( twig_handlers => { content => sub { $_->print; print "\n"; }, }, ); $twig->parse($xml); $twig->purge;
|
|---|