Xerces2-J
  1. Xerces2-J
  2. XERCESJ-1102

Wrong value of xml:base attribute after resolving XInclude references

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.7.1
    • Fix Version/s: None
    • Component/s: XInclude 1.0
    • Labels:
      None
    • Environment:
      J2SE 1.5.0_04

      Description

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

      1. 1102-improved.patch
        1 kB
        Franziska Meyer
      2. bug-1102.patch
        1 kB
        Franziska Meyer
      3. XercesXIncludeBug.zip
        1.0 kB
        Sorin Ristache

        Activity

        Hide
        Sorin Ristache added a comment -

        Archive with test files for reproducing the bug.

        Show
        Sorin Ristache added a comment - Archive with test files for reproducing the bug.
        Hide
        Mansour Al Akeel added a comment -

        This bug was created on Oct 4, 2005. Currently it's Feb 24 2008. Is there any plan to resolve this bug ??

        Show
        Mansour Al Akeel added a comment - This bug was created on Oct 4, 2005. Currently it's Feb 24 2008. Is there any plan to resolve this bug ??
        Hide
        Franziska Meyer added a comment -

        The given patch for XIncludeHandler solves the bug for me.

        Show
        Franziska Meyer added a comment - The given patch for XIncludeHandler solves the bug for me.
        Hide
        Sorin Ristache added a comment -

        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.

        Show
        Sorin Ristache added a comment - 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.
        Hide
        Franziska Meyer added a comment -

        1102-improved.patch solves the problem with absolute paths (it replaces the first patch)

        Show
        Franziska Meyer added a comment - 1102-improved.patch solves the problem with absolute paths (it replaces the first patch)
        Hide
        Sorin Ristache added a comment -

        Yes, this patch uses the correct relative path in the xml:lang attribute.

        Show
        Sorin Ristache added a comment - Yes, this patch uses the correct relative path in the xml:lang attribute.
        Hide
        Martin Večeřa added a comment -

        Hello, when do you suppose this patch can make it to a release? Even Xerces 2.9.1 still contains the bug. Is there anything I can help with (writing a test, verifying the fix...)? Thanks!

        Show
        Martin Večeřa added a comment - Hello, when do you suppose this patch can make it to a release? Even Xerces 2.9.1 still contains the bug. Is there anything I can help with (writing a test, verifying the fix...)? Thanks!

          People

          • Assignee:
            Michael Glavassevich
            Reporter:
            Sorin Ristache
          • Votes:
            6 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:

              Development