commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@codehaus.org
Subject [jira] Updated: (JELLY-28) Bad entity processing
Date Thu, 04 Sep 2003 21:14:11 GMT
The following issue has been updated:

    Updater: Morgan Delagrange (mailto:mdelagra@yahoo.com)
       Date: Thu, 4 Sep 2003 4:12 PM
    Changes:
             timeoriginalestimate changed from 0
             timeestimate changed from 0 minutes
             Component changed to core / taglib.core
             Component changed from tags
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://jira.codehaus.org/secure/ViewIssue.jspa?key=JELLY-28&page=history

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

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


Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JELLY-28
    Summary: Bad entity processing
       Type: Bug

     Status: Assigned
   Priority: Major

 Time Spent: Unknown
  Remaining: Unknown

    Project: jelly
 Components: 
             core / taglib.core

   Assignee: james strachan
   Reporter: Incze Lajos

    Created: Thu, 30 Jan 2003 7:44 PM
    Updated: Thu, 4 Sep 2003 4:12 PM
Environment: No special environment.

Description:
Have a file, name it a.xml with this content:

-----------------------------
<?xml version="1.0"?>
<!DOCTYPE a [
<!ENTITY x "y">
]>
<a>&x;</a>
-----------------------------

Run the below simple (maven) jelly script:

-----------------------------
<project default="java:jar"
         xmlns:j="jelly:core"
         xmlns:x="jelly:xml">

  <goal name="emnl:test">
    <x:parse var="doc" xml="a.xml"/>
    <echo><x:copyOf select="$doc"/></echo>
  </goal>

</project>
-----------------------------

The result will be this:


-----------------------------
....
emnl:test:
    [echo] <?xml version="1.0" encoding="UTF-8"?>
<a>&x;y</a>
BUILD SUCCESSFUL
-----------------------------

I'm aware of the fact that the bug originally comes from dom4j.
The below dom4j program fragment

-----------------------------
....
  SAXReader xmlReader = new SAXReader();
  Document doc = xmlReader.read("a.xml");
  XMLWriter writer = new XMLWriter(System.out);
  writer.write(doc);
  writer.flush();
....
-----------------------------

will output this result:

-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE a><a>&x;</a>
-----------------------------

which is bad (not even well-formed). I've filed this issue
at the dom4j bugtracker
(http://sourceforge.net/tracker/?group_id=16035&atid=116035)
under the number 676427, with some notes one the possible
resolution.

But as we can see, the jelly xml tag adds a twist to the dom4j bug,
it inserts both the entity and the entity value into the tag.

Thanks, incze


---------------------------------------------------------------------
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


Mime
View raw message