You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent Perez <ha...@gmail.com> on 2005/03/10 16:42:08 UTC
JXTemplate and characters escaping
Hello
Is the JXTemplateGenerator auto-escaping required HTML chars when they
are extracted as bean properties ? I have a weird problem with the
following piece of jx code + xsl transformation (<xsl:value-of
select="/foo">) :
<foo>é</foo> renders é.
however,
<foo>#{bean.bar}</foo> renders &#233; (bar being "é" in my database)
The following being observed with a <map:serialize type="xml"/> right
after the jxtemplate generation, before the xslt transformation.
Is it possible to tell the jxtemplate not to escape these chars ?
Thanks
Laurent
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate and characters escaping
Posted by Ellis Pritchard <el...@nukinetics.com>.
You could try wrapping the expression in a CDATA section; JXTemplate
interprets expressions inside the CDATA, but then passes the CDATA
itself through.
e.g.
<foo><![CDATA[#{bean.bar}]]></foo>
Should output as:
<foo><![CDATA[é]]></foo>
The XSL can then select this out with <xsl:value-of select="foo"
disable-output-escaping="yes"/>, or you may not have to worry about
that... have an experiment!
Ellis.
On 10 Mar 2005, at 15:42, Laurent Perez wrote:
> Hello
>
> Is the JXTemplateGenerator auto-escaping required HTML chars when they
> are extracted as bean properties ? I have a weird problem with the
> following piece of jx code + xsl transformation (<xsl:value-of
> select="/foo">) :
>
> <foo>é</foo> renders é.
> however,
> <foo>#{bean.bar}</foo> renders &#233; (bar being "é" in my
> database)
>
> The following being observed with a <map:serialize type="xml"/> right
> after the jxtemplate generation, before the xslt transformation.
>
> Is it possible to tell the jxtemplate not to escape these chars ?
>
> Thanks
>
> Laurent
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org