commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] body as unescaped xml
Date Wed, 26 Feb 2003 15:41:59 GMT
 From: "Wannheden, Knut" <knut.wannheden@paranor.ch>
> Hi,
>
> I was surprised when I noticed that the following two scipts snippets
don't
> 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
a
good
> 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">
        <foo/>
    <j:set>

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
true/false.

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Mime
View raw message