Issue Details (XML | Word | Printable)

Key: JELLY-28
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: dion gillard
Reporter: Incze Lajos
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Jelly

Bad entity processing

Created: 31/Jan/03 03:44 AM   Updated: 27/Aug/04 04:39 AM
Return to search
Component/s: core / taglib.core
Affects Version/s: None
Fix Version/s: 1.0-beta-4

Time Tracking:
Not Specified

File Attachments:
  Size
Zip Archive Licensed for inclusion in ASF works lexical-patches.zip 2004-08-27 12:49 AM Hans Gilde 2 kB
Environment: No special environment.

Resolution Date: 27/Aug/04 04:39 AM


 Description  « Hide
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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Morgan Delagrange made changes - 04/Sep/03 11:12 PM
Field Original Value New Value
Original Estimate 0
Remaining Estimate 0h [ 0 ]
Component/s core / taglib.core [ 10421 ]
Component/s tags [ 10012 ]
Morgan Delagrange made changes - 09/Sep/03 05:49 PM
Priority Major [ 3 ] Blocker [ 1 ]
Affects Version/s 1.0 [ 10216 ]
Morgan Delagrange made changes - 09/Sep/03 05:50 PM
Fix Version/s 1.0 [ 10216 ]
Affects Version/s 1.0 [ 10216 ]
Morgan Delagrange made changes - 09/Sep/03 06:05 PM
Fix Version/s 1.0-beta-4 [ 10215 ]
Fix Version/s 1.0 [ 10216 ]
Hans Gilde made changes - 27/Aug/04 12:49 AM
Attachment lexical-patches.zip [ 14984 ]
dion gillard made changes - 27/Aug/04 04:23 AM
Assignee james strachan [ jstrachan ] dion gillard [ diongillard ]
dion gillard made changes - 27/Aug/04 04:23 AM
Status Open [ 1 ] In Progress [ 3 ]
dion gillard made changes - 27/Aug/04 04:39 AM
Resolution Fixed [ 1 ]
Status In Progress [ 3 ] Closed [ 6 ]