Issue Details (XML | Word | Printable)

Key: XERCESJ-1102
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Sorin Ristache
Votes: 3
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Xerces2-J

Wrong value of xml:base attribute after resolving XInclude references

Created: 04/Oct/05 11:38 PM   Updated: 25/Apr/08 01:39 PM
Return to search
Component/s: XInclude 1.0
Affects Version/s: 2.7.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 1102-improved.patch 2008-04-25 12:20 PM Franziska Meyer 1 kB
Text File Licensed for inclusion in ASF works bug-1102.patch 2008-04-25 09:07 AM Franziska Meyer 1 kB
Zip Archive Licensed for inclusion in ASF works XercesXIncludeBug.zip 2005-10-04 11:40 PM Sorin Ristache 1.0 kB
Environment:
J2SE 1.5.0_04


 Description  « Hide
The value of the xml:base attribute is not computed correctly for files included with XInclude starting with nesting level 2. After resolving the XInclude references the path stored in the xml:base value should be relative to the including document, not relative to the master document.

To reproduce the bug, unarchive the attached zip in the Xerces install directory and in that directory execute the command line

java -cp xercesImpl.jar;xercesSamples.jar sax.Writer -xi XercesXIncludeBug\a.xml

The document echoed in the console contains a "c" element with xml:base="b/c/c.xml". It should be xml:base="c/c.xml".

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sorin Ristache added a comment - 04/Oct/05 11:40 PM
Archive with test files for reproducing the bug.

Mansour Al Akeel added a comment - 24/Feb/08 05:50 AM
This bug was created on Oct 4, 2005. Currently it's Feb 24 2008. Is there any plan to resolve this bug ??

Franziska Meyer added a comment - 25/Apr/08 09:07 AM
The given patch for XIncludeHandler solves the bug for me.

Sorin Ristache added a comment - 25/Apr/08 10:04 AM
The patch inserts a correct value for the xml:base attribute but it is the absolute path for the included fragment. I think the correct relative path in the xml:base attribute would be more readable / easy to use for an XML user.

Franziska Meyer added a comment - 25/Apr/08 12:20 PM
1102-improved.patch solves the problem with absolute paths (it replaces the first patch)

Sorin Ristache added a comment - 25/Apr/08 01:39 PM
Yes, this patch uses the correct relative path in the xml:lang attribute.