remiah has asked for the wisdom of the Perl Monks concerning the following question:
Hello perlmonk.
Today I found XML::Twig as an HTML parser fails at contents that includes
For example, this will cause parse error;&
And this will parse ok, and print contents.#!perl use strict; use warnings; use XML::Twig; my $twig= new XML::Twig(pretty_print => 'indented'); $twig->parse_html( join('',<DATA>) )->print; __DATA__ <html> <body> <div>M&M</div> </body> </html>
So, I thought this is known problem but couldn't find good work around.#!perl use strict; use warnings; use XML::Twig; my $twig= new XML::Twig(pretty_print => 'indented'); $twig->parse_html( join('',<DATA>) )->print; __DATA__ <html> <body> <div>M&amp;M</div> </body> </html>
I found this with strawberry perl 5.16.1.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XML::Twig parse html trouble
by roboticus (Chancellor) on Feb 20, 2014 at 18:48 UTC | |
by remiah (Hermit) on Feb 20, 2014 at 20:36 UTC | |
Re: XML::Twig parse html trouble
by remiah (Hermit) on Feb 20, 2014 at 18:40 UTC | |
Re: XML::Twig parse html trouble ( Bug #86633 )
by Anonymous Monk on Feb 21, 2014 at 03:38 UTC | |
by remiah (Hermit) on Feb 21, 2014 at 07:20 UTC |
Back to
Seekers of Perl Wisdom