blitzkrieg has asked for the wisdom of the Perl Monks concerning the following question:
The code snippet below produces the latter results and you can generate the former by commenting the output_text_filter line:Input: <pre>won't escape properly - uggh!</pre> Desired Output: <pre>won't escape properly - uggh!</pre> Actual Output: <pre>won't escape properly - uggh!</pre>; or &lt;pre>won't escape properly - uggh!&lt;/pre>
blitzkrieguse XML::Twig; my $tTwig = XML::Twig->new( pretty_print => 'indented', output_text_filter => 'html', ); $tTwig->set_xml_version( '1.0' ); $tTwig->set_output_encoding( 'utf-8' ); my $tLog = XML::Twig::Elt->new( 'log', q(<pre>won't escape properly - +uggh!</pre>) ); $tTwig->set_root( $tLog ); $tTwig->print;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Twig and HTML Entities
by bpphillips (Friar) on Nov 12, 2004 at 19:23 UTC | |
by blitzkrieg (Initiate) on Nov 12, 2004 at 20:01 UTC | |
by Anonymous Monk on Nov 12, 2004 at 20:19 UTC | |
by blitzkrieg (Initiate) on Nov 12, 2004 at 21:28 UTC | |
by bpphillips (Friar) on Nov 13, 2004 at 01:47 UTC | |
|
Re: XML::Twig and HTML Entities
by bpphillips (Friar) on Nov 12, 2004 at 20:20 UTC |