NAME
HTML::Template::Compiled::Plugin::XMLEscape - XML-Escaping for HTC
SYNOPSIS
my
$htc
= HTML::Template::Compiled->new(
plugin
=> [
qw(HTML::Template::Compiled::Plugin::XMLEscape)
],
...
);
METHODS
- register
-
gets called by HTC
- escape_xml
-
escapes data for XML CDATA.
- escape_xml_attr
-
escapes data for XML attributes
EXAMPLE
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'
,
);
$htc
->output;
Output:
<foo attr=
"foo & bar"
>text
<
;
with
>
; tags</foo>