HTML-Template-Compiled

 view release on metacpan or  search on metacpan

lib/HTML/Template/Compiled/Plugin/XMLEscape.pm  view on Meta::CPAN

escapes data for XML attributes

=back

=head1 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>

=cut



( run in 0.613 second using v1.01-cache-2.11-cpan-454fe037f31 )