You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Marc DEXET <Ma...@dsi.cnrs.fr> on 2005/01/25 17:49:35 UTC

RE : RE : [jelly] SetTag and XML entities

And with :

 <j:file name="myFile" omitXmlDeclaration="true" escapeText="false">
 <j:set var="test" escapeText="false">a&lt;b &amp;&amp; c&gt;d</j:set>
 if ( ${test} )
 </j;file>

set inherits from tagSupport, which accepts escapeText as filetag.

-- 
Marc DeXeT
CNRS
- Gelée camembert, c'est ici http://jelly.fr.free.fr/index.php - 

> -----Message d'origine-----
> De : Jean-Michel FRANCOIS [mailto:jmf@mururoa.com]
> Envoyé : mardi 25 janvier 2005 16:47
> À : commons-user@jakarta.apache.org
> Objet : RE : [jelly] SetTag and XML entities
> 
> 
> > Try exprTag
> It still fails.
> 
> The use-case is
> <j:file name="myFile" omitXmlDeclaration="true" escapeText="false">
> <j:set var="test">a&lt;b &amp;&amp; c&gt;d</j:set>
> if ( ${test} )
> </j;file>
> Output is : if ( a&lt;b &amp;&amp; c&gt;d ) and should be:
>  if ( a<b && c>d )
> 
> I found a hack using the jelly:util replace tag, but we can't say it's a
> good solution. ;-)
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org

Re: RE : RE : [jelly] SetTag and XML entities

Posted by Jean-Michel FRANCOIS <jm...@mururoa.com>.
> And with :
> 
>  <j:file name="myFile" omitXmlDeclaration="true" escapeText="false">
>  <j:set var="test" escapeText="false">a&lt;b &amp;&amp; c&gt;d</j:set>
>  if ( ${test} )
>  </j;file>
> 
> set inherits from tagSupport, which accepts escapeText as filetag.
> 
In that case the escapeText attribute with a value of false do nothing
and with a value of true will output for the above code:
if ( a&amp;lt;b &amp;amp;&amp;amp; c&amp;gt;d )
Actually, it permits to convert XML characters to entities. In our case,
the XML character is '&' which becomes '&amp;'.




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org