<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>4373</bug_id>
          
          <creation_ts>2007-03-07 10:43:01 +0000</creation_ts>
          <short_desc>[FO] resolve-uri() where $base is relative</short_desc>
          <delta_ts>2007-11-16 09:10:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 1.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>14336</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-03-07 10:43:01 +0000</bug_when>
    <thetext>The specification of resolve-uri() is unclear about what happens when the $base argument is itself a relative URI.

At one stage the specification stated this was an error, and my recollection is that we made a deliberate decision to change this. However, the summary still states &quot;The purpose of this function is to enable a relative URI to be resolved against an absolute URI&quot;, and the body of the specification states &quot;and the resulting absolute URI reference is returned&quot; (if $base is allowed to be relative, then the result will also be relative).

The question was raised in a challenge to the published results of XSLT test case reluri19, which assume that resolving against a relative URI is permitted: see http://www.w3.org/Member/bugzilla/show_bug.cgi?id=684 (member-only)

My proposed resolution would be to issue an editorial clarification to make it clear that $base is allowed to be relative, and that in this case the result will also be relative.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14349</commentid>
    <comment_count>1</comment_count>
    <who name="Colin Adams">colin</who>
    <bug_when>2007-03-08 07:51:20 +0000</bug_when>
    <thetext>Please see my additional comment to bug 684.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14652</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-04-03 21:33:50 +0000</bug_when>
    <thetext>The WGs reviewed this today. It was accepted that RFC 3986 makes it fairly clear that the algorithm it describes for resolving a &quot;relative reference&quot; (which we incorrectly refer to as a relative URI) is intended to take an absolute hierarchic URI as the base URI input, and to produce an absolute hierarchic URI as the result. I was asked to produce a concrete wording proposal for an erratum. Here is proposed wording:

Summary: This function enables a relative URI reference to be resolved against a base URI to produce an absolute URI.

The first form of this function resolves $relative against the value of the base-uri property from the static context. If the base-uri property is not initialized in the static context an error is raised [err:FONS0005].

If $relative is a relative URI reference, it is resolved against $base, or against the base-uri property from the static context, using an algorithm such as those described in [RFC 2396] or [RFC 3986], and the resulting absolute URI reference is returned. 

If $relative is an absolute URI reference, it is returned unchanged.

If $relative is the empty sequence, the empty sequence is returned.

If $relative is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable relative reference to use as input to the chosen resolution algorithm then an error is raised [err:FORG0002].

If $base is not a valid URI according to the rules of the xs:anyURI data type, or if it is not a suitable URI to use as input to the chosen resolution algorithm (for example, if it is a relative URI reference, if it is a non-hierarchic URI, or if it contains a fragment identifier) then an error is raised [err:FORG0002].

If the chosen resolution algorithm fails for any other reason then an error is raised [err:FORG0009].

Notes:

Resolving a URI does not dereference it. This is merely a syntactic operation on two character strings.

The algorithms in the cited RFCs include some variations that are optional or recommended rather than mandatory; they also describe some common practices that are not recommended, but which are permitted for backwards compatibility. Where the cited RFCs permit variations in behavior, so does this specification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14734</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-04-16 21:27:18 +0000</bug_when>
    <thetext>The WGs today accepted the change as proposed. I am therefore closing the bug report.

Michael Kay
for the XSL and XQuery WGs</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17764</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-11-16 09:10:28 +0000</bug_when>
    <thetext>This will appear as erratum FO.E1</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>