commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [jelly] body as unescaped xml
Date Wed, 26 Feb 2003 15:41:59 GMT
 From: "Wannheden, Knut" <>
> Hi,
> I was surprised when I noticed that the following two scipts snippets
> produce the same result:
> <foo/>
> and:
> <j:set var="bar">
> <foo/>
> </j:set>
> ${bar}
> The first one produces something like "<foo></foo>" whereas the second
> produces something like "&lt;foo&gt;&lt;/foo&gt;".  I'm sure there's
> reason for this I can't seem to think of... can someone explain it to me?
> Also, is there another way to achieve what I'm trying to do?

This is kinda non intuitive. I think we should probably fix it.

Basically when XML is output as text it can be encoded into a valid XML
string or left as is. So tags like <j:set> allow XML encoding to be turned
on or off.

    <j:set var="bar" encoding="false">

For some reason the default is to encode as XML text (I can't remember why
this is so). This is probably not a good thing; encoding should probably be
disabled by default. For now you can just specify the default encoding


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

View raw message