<?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>20642</bug_id>
          
          <creation_ts>2013-01-11 09:32:17 +0000</creation_ts>
          <short_desc>[FO30] non-hierarchic URIs</short_desc>
          <delta_ts>2013-03-12 16:14:23 +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 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</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="Tim Mills">tim</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>liam</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>81224</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-01-11 09:32:17 +0000</bug_when>
    <thetext>fn:resolve-uri makes reference to non-hierarchic URIs.

I couldn&apos;t find a description of how to determine whether a URI is non-hierachic.

I&apos;m guessing that it is what Java describes as Opaque URIs, rather than requiring knowledge of the specifics of all possible URI schemes.

Could this be clarified in the specification?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81227</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-11 10:16:22 +0000</bug_when>
    <thetext>The term &quot;hierarchic&quot; is used in the sense of RFC 3986, which uses the term extensively though it does not define it formally.

RFC 3986 in its list of changes states &quot;All references to &quot;opaque&quot; URIs have been replaced with a better description of how the path component may be opaque to hierarchy.&quot; Java is using the old terminology.

I&apos;m happy to add an informal explanation, e.g. hierarchic URI (in the sense of RFC 3986).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81231</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-01-11 10:42:34 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; The term &quot;hierarchic&quot; is used in the sense of RFC 3986, which uses the term
&gt; extensively though it does not define it formally.

I read through that, and it does refer to &quot;base URI has a non-hierarchical path&quot; but I couldn&apos;t point to anything obvious in the specification that identified that non-hierarchical paths meant URIs which match the path-rootless production.

It&apos;s more obvious from the RFC 2396 production:

      absoluteURI   = scheme &quot;:&quot; ( hier_part | opaque_part )


The text from RFC 3986:

&quot;For some URI
 schemes, the visible hierarchy is limited to the scheme itself:
 everything after the scheme component delimiter (&quot;:&quot;) is considered
 opaque to URI processing.  Other URI schemes make the hierarchy
 explicit and visible to generic parsing algorithms.&quot;

seems to indicate that the hierachic nature is dependent on the scheme.  e.g. mailto is always non-hierarchic, http is always hierarchic.

&gt; I&apos;m happy to add an informal explanation, e.g. hierarchic URI (in the sense
&gt; of RFC 3986).

Yes please - or a fairly specific reference into the RFC.  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81232</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-01-11 11:38:25 +0000</bug_when>
    <thetext>The text

&quot;  A path consists of a sequence of path segments separated by a slash
   (&quot;/&quot;) character.  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. &quot;

might lead one to believe that a URI is hierarchic if it contains a slash.

Microsoft&apos;s .NET System.Uri class allows resolution against &quot;opaque&quot; URLs.  Why does F&amp;O forbid it, since an &quot;opaque&quot; URI is absolute?

var urn = new Uri(&quot;urn:isbn:foo&quot;);
var mailto = new Uri(&quot;mailto:you@example.org&quot;);
var foo = new Uri(urn, mailto);
Console.WriteLine(foo); // prints mailto:tim@cbcl.co.uk

var bar = new Uri(mailto, urn);
Console.WriteLine(bar); // prints urn:isbn:foo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81248</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2013-01-11 16:29:25 +0000</bug_when>
    <thetext>As regards your example, I think this rule:

If $relative is an absolute IRI (as defined above), then it is returned unchanged.

is intended to take precedence over this one:

A dynamic error is raised [err:FORG0002] if $base is not ... a suitable IRI to use ...

I agree that isn&apos;t necessarily clear in the spec.

Is this what the issue is here?

As regards the definition of a &quot;non-hierarchic URI&quot;, I don&apos;t want to attempt to publish any kind of interpretation or clarification of the RFC: if timbl thinks it&apos;s a good enough specification, then it&apos;s not for me to say he&apos;s wrong. If there&apos;s more than one interpretation of what the term means, then I&apos;m happy to say that you can use whichever one you want. The RFC states in 1.2.3 &quot;...relative references can only be used within the context of a hierarchical URI&quot;, and we are merely referring to that statement, not attempting to amplify it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81257</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-01-11 17:45:07 +0000</bug_when>
    <thetext>
&gt; Is this what the issue is here?

No.  My example was wrong.  I meant to use &quot;b.html&quot; as one of the URIs.  .NET does indeed through a (rather obscure) error when trying to resolve this against the URN.  Just ignore all that!

The issue is how to determine what constitutes a non-hierarchic URI.  I&apos;m guessing what Java identifies as Opaque URIs is one approximation.  But I suspect it really boils down to how any specific URI scheme has been defined - and that&apos;s covered by scheme specific RFCs, not RFC 3986.  In that sense, RFC 3986 isn&apos;t at all at fault.

Were we to add the test:

resolve-uri(&quot;b.html&quot;, &quot;http:01234567890X&quot;)

what result would you expect?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81267</commentid>
    <comment_count>6</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2013-01-11 18:29:38 +0000</bug_when>
    <thetext>Tim, yes, individual URI scheme registrations are responsible for saying whether a URI is hierarchical.

I agree it&apos;s messy, and if a library decides to be over-optimistic and allow resolution of a relative URI against against, say, a mailto: URI, it&apos;s up to the user not to do that :-) - otherwise you&apos;d be stuck when a new hierarchical scheme was defined that the library didn&apos;t recognise.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84297</commentid>
    <comment_count>7</comment_count>
    <who name="Tim Mills">tim</who>
    <bug_when>2013-03-12 16:14:07 +0000</bug_when>
    <thetext>The WG discussed this in Agenda 2013-03-05 and decided no change was to be made to the specification.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>