The following comment has been added to this issue:

     Author: Knut Wannheden
    Created: Thu, 4 Sep 2003 2:33 AM
       Body:
I suppose this is really two problems then.  The first being that <j:set> sets the 
value of the variable to a String value even though the body is XML.  And the second 
being that XMLOutput by default escapes text using XML entities.

But of course these two are linked to each other.  If just one of them is fixed my 
problem is solved.

The first one probably requires some thought and should maybe be implemented using a 
new tag as you say.

The second one is really easy to solve, and makes a lot of sense IMHO.  Also it makes 
a workaround for the first problem possible:

<j:set var="foo">
 <foo/>
</j:set>
<xml:parse var="foo">
 ${foo}
</xml:parse>

Of course that would already be possible now, but you would have to do the second step 
like this:

<xml:parse var="foo" text="${foo}"/>

Now that these two don't behave the same is really ugly.

---------------------------------------------------------------------
View the issue:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=JELLY-66


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JELLY-66
    Summary: tag body as unescaped xml
       Type: Bug

     Status: Unassigned
   Priority: Major

 Time Spent: Unknown
  Remaining: Unknown

    Project: jelly
 Components: 
             taglib.core
             tags

   Assignee: 
   Reporter: Knut Wannheden

    Created: Mon, 28 Jul 2003 2:32 AM
    Updated: Mon, 28 Jul 2003 2:32 AM

Description:
(I've reported this problem to commons-user before.  See thread "[jelly] body as 
unescaped xml".)

The following snippet exposes the problem:

<j:set var="foo">
   <foo/>
</j:set>
${foo}

I expected the output to be "<foo></foo>" (or "<foo/>") but it is actually 
"&lt;foo&gt;&lt;/foo&gt;".

The problem is that there is no way to control this behaviour.  The reason is that the 
factory methods of XMLOutput by default return an instance which escapes body text 
with XML entities (as in the example).  In many applications this makes sense, but ss 
Jelly is primarily a tool to manipulate XML, I think the default should be _not_ to 
escape XML.  (Also read the discussion in http://www.mail-archive.com/[EMAIL 
PROTECTED]/msg02750.html.)

In the example the variable "foo" actually gets assigned the String value 
"<foo></foo>", which is escaped when it's dereferenced using "${foo}".  The question 
is whether the value should really be a String.  Shouldn't it really be XML?


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to