Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2274

Base URI is not correct for elements in external entities in input documents or stylesheets or elements specifying xml:base

    XMLWordPrintableJSON

Details

    Description

      According to section 4.2 of the XML Base Recommendation,[1]

      The base URI of an element is:

      • the base URI specified by an xml:base attribute on the element, if one exists, otherwise
      • the base URI of the element's parent element within the document or external entity, if one exists, otherwise
      • the base URI of the document entity or external entity containing the element.

      Neither Xalan-J Interpretive nor XSLTC seems to correctly compute the base URI of elements that have an xml:base attribute or that are in external entities. This can be seen in a reference to the document function, where the first argument is a string containing a relative URI and the second argument either is absent, in which case the base URI of the element in the stylesheet that contains the expression should be used as the base against which the first argument is resolved, or is a node-set, in which case the base URI of the first node in the node-set in document order should be used as the base against which the first argument is resolved.[2]

      [1] http://www.w3.org/TR/xmlbase/
      [2] http://www.w3.org/TR/xslt#document

      Attachments

        1. j2274.tar
          20 kB
          Henry Zongaro
        2. patch2.txt
          9 kB
          Brian Minchau

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zongaro@ca.ibm.com Henry Zongaro
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: