You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@jakarta.apache.org on 2004/09/02 08:40:50 UTC

[jira] Commented: (JELLY-66) tag body as unescaped xml

The following comment has been added to this issue:

     Author: dion gillard
    Created: Wed, 1 Sep 2004 11:39 PM
       Body:
You can use the core:file tag for this as well.
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/JELLY-66?page=comments#action_38033

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JELLY-66

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

     Status: Unassigned
   Priority: Major

    Project: jelly
 Components: 
             core / taglib.core
   Fix Fors:
             1.0

   Assignee: 
   Reporter: Knut Wannheden

    Created: Mon, 28 Jul 2003 2:32 AM
    Updated: Wed, 1 Sep 2004 11:39 PM

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/commons-user@jakarta.apache.org/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://issues.apache.org/jira/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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org