<?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>28272</bug_id>
          
          <creation_ts>2015-03-22 15:59:17 +0000</creation_ts>
          <short_desc>[QT3TS] fn-resolve-uri-28, non-hierarchical uris, test should not raise FORG0002</short_desc>
          <delta_ts>2015-04-01 23:06: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>XQuery 3 &amp; XPath 3 Test Suite</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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="Abel Braaksma">abel.braaksma</reporter>
          <assigned_to name="O&apos;Neil Delpratt">oneil</assigned_to>
          <cc>mike</cc>
          
          <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>118788</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-03-22 15:59:17 +0000</bug_when>
    <thetext>Test fn-resolve-uri-28 expects error FORG0002 on resolve-uri(&quot;b.html&quot;, &quot;urn:isbn:01234567890X&quot;), but I can&apos;t find anything in http://www.ietf.org/rfc/rfc3986.txt that disallows that.

The URN fits the production of an absolute URI with scheme &quot;urn&quot; and path &quot;isbn:01234567890X&quot;.

The algorithm in 5.2.2 skips to the merge(Base.path, R.path) line (non-empty R.path and not starting with &quot;/&quot;). The relevant part of the merge function (section 5.2.3) says:

  * return a string consisting of the reference&apos;s path component
    appended to all but the last segment of the base URI&apos;s path (i.e.,
    excluding any characters after the right-most &quot;/&quot; in the base URI
    path, or excluding the entire base URI path if it does not contain
    any &quot;/&quot; characters).

In other words, the path-part must be removed and the resulting URI will then be &quot;urn:b.html&quot;. 

Uncommon, but not an illegal result. I doubt that this should raise FORG0002.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>118790</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-03-22 19:37:40 +0000</bug_when>
    <thetext>The current wording of the spec was introduced in Erratum E1 to the 2007 edition of Functions and Operators, and the discussion is reported in bug #4373.

I think that the test fairly reflects the decisions of the WG reported in that discussion. I agree that the term &quot;non-hierarchic URI&quot; is not very clearly defined (like many other aspects of URIs), but I think it means a URI in a scheme that uses a non-hierarchic path component, of which the &quot;urn&quot; scheme is the classic example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119139</commentid>
    <comment_count>2</comment_count>
    <who name="O&apos;Neil Delpratt">oneil</who>
    <bug_when>2015-03-31 14:23:44 +0000</bug_when>
    <thetext>I assume nothing should be done with this bug issue. Please reopen if you disagree</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119186</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-04-01 23:06:28 +0000</bug_when>
    <thetext>I think you are right. I mainly had a hard time finding out what a hierarchical URI is (in unambiguous terms), but after a couple of times rereading, I found this in the RFC:

   A path is always defined for a URI, though the
   defined path may be empty (zero length).  Use of the slash character
   to indicate hierarchy is only required when a URI will be used as the
   context for relative references.

Then I thought this still leaves schemes like palm:service/option1/option2 (apparently this really exists), which contain a slash and have a non-zero length path, but later I see:

   In addition, a URI reference (Section 4.1) may be a relative-path reference, 
   in which case the first path segment cannot contain a colon (&quot;:&quot;) character.

To conclude, it took me a while to grasp it, but it is all there, somewhere ;), and indeed, the test is good (and our results faulty).

As an aside, it was Oracle who defined it much easier:

   A hierarchical URI is either an absolute URI whose scheme-specific part 
   begins with a slash character, or a relative URI, that is, a URI that does 
   not specify a scheme. 

       -- from http://docs.oracle.com/javase/7/docs/api/java/net/URI.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>