in reply to Parse with XML::Simple: how to keep some tags "unparsed"?

Did you take a look at XML::Twig? AFAIK it's very flexible in parsing/filtering tags.

  • Comment on Re: Parse with XML::Simple: how to keep some tags "unparsed"?

Replies are listed 'Best First'.
Re^2: Parse with XML::Simple: how to keep some tags "unparsed"?
by qq (Hermit) on Jul 05, 2004 at 09:08 UTC
    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;