commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Libbrecht <p...@activemath.org>
Subject Re: [jelly] How to escape character '&'
Date Thu, 11 Aug 2005 23:16:31 GMT
How do you know it ?
When outputting the character "&" in XML, it has to be output as 
"&amp;"...

I just tried the following:

		<j:set var="x" value="a&amp;a"/>
		<log:info>x${x}</log:info>

and this gave me:

         INFO: xa&a

But note... I'm using log:info and not outputting to the XML-stream!
Using getstatic, invokestatic and System.out.println should give you 
the same result as well.
Alternatively, peeling each character should help as well.

Hope this helps.

paul



Le 12 août 05, à 00:48, Guo, Jiaqi a écrit :

> Thanks for reply.
>
> This doesn't seem to work. &amp; is interpreted into &amp;amp; when I 
> set the value to the variable no matter the escapeText attribute is 
> true or false. Wrapping with CDATA doesn't help either.
>
>
> Regards
>
> Jiaqi
> jiaqi.guo@gmail.com
> http://www.cyclopsgroup.com
>
>
> Paul Libbrecht wrote:
>
>> If you want exactly this sequence of characters you need exactly this 
>> one: aaa&amp;bbb&amp;ccc
>>
>> hope that helps.
>>
>> paul
>>
>>
>> Le 11 août 05, à 23:33, Guo, Jiaqi a écrit :
>>
>>> I couldn't find the answer from the website. What I want to do is 
>>> very simple.
>>> ...
>>> <j:set var="someVariable">aaa&bbb&ccc</j:set>
>>> or
>>> <j:set var="someVariable" value="aaa&bbb&ccc"/>
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>>
>>> Regards
>>>
>>> Jiaqi
>>>
>>> jiaqi.guo@gmail.com
>>> http://www.cyclopsgroup.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


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


Mime
View raw message