logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

HTML::Template::Compiled::Plugin::XMLEscape - XML-Escaping for HTC

Example

           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 &amp; bar">text &lt; with &gt; tags</foo>

perl v5.36.0                                       2022-11-19              HTML::Template...ugin::XMLEscape(3pm)

Methods

       register
           gets called by HTC

       escape_xml
           escapes data for XML CDATA.

       escape_xml_attr
           escapes data for XML attributes

Name

       HTML::Template::Compiled::Plugin::XMLEscape - XML-Escaping for HTC

Synopsis

           use HTML::Template::Compiled::Plugin::XMLEscape;

           my $htc = HTML::Template::Compiled->new(
               plugin => [qw(HTML::Template::Compiled::Plugin::XMLEscape)],
               ...
           );

See Also