HTML::Template::Compiled::Plugin::XMLEscape - XML-Escaping for HTC
use HTML::Template::Compiled::Plugin::XMLEscape; my $htc = HTML::Template::Compiled->new( plugin => [qw(HTML::Template::Compiled::Plugin::XMLEscape)], ... );
gets called by HTC
escapes data for XML CDATA.
escapes data for XML attributes
use HTML::Template::Compiled::Plugin::XMLEscape; my $htc = HTML::Template::Compiled->new( plugin => [qw(HTML::Template::Compiled::Plugin::XMLEscape)], tagstyle => [qw(-classic -comment -asp +tt)], scalarref => \'<foo attr="[%= attribute %]">[%= cdata escape=XML %]</foo>', default_escape => 'XML_ATTR', ); $htc->param( attr => 'foo & bar', cdata => 'text < with > tags', ); print $htc->output;
Output:
<foo attr="foo & bar">text < with > tags</foo>
To install HTML::Template::Compiled, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Template::Compiled
CPAN shell
perl -MCPAN -e shell install HTML::Template::Compiled
For more information on module installation, please visit the detailed CPAN module installation guide.