<?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>3959</bug_id>
          
          <creation_ts>2006-11-08 00:03:53 +0000</creation_ts>
          <short_desc>fn-base-uri-23 incorrect URI?</short_desc>
          <delta_ts>2006-12-26 08:37:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Query Test Suite</product>
          <component>XML Query Test Suite</component>
          <version>1.0.1</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</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="Ivan Shcheklein">vano_msu</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</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>12855</commentid>
    <comment_count>0</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-11-08 00:03:53 +0000</bug_when>
    <thetext>The query is as follows:

fn:string(fn:base-uri(&lt;anElement
xml:base=&quot;http:\\example.com\\examples&quot;&gt;Element content&lt;/anElement&gt;))

In RFC 2616 we read:

http_URL = &quot;http:&quot; &quot;//&quot; host [ &quot;:&quot; port ] [ abs_path [ &quot;?&quot; query ]]

So, possibly, expected result must be FORG0001?

Thanks,
Ivan</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12860</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-11-08 09:32:34 +0000</bug_when>
    <thetext>There&apos;s been a fair bit of discussion about this test case, I suggest you search for the test name in the archives. The XML Base specification does not require the value of the xml:base attribute to be a valid URI (whether against RFC 2616 or against any other RFC). Rather, section 3.1 says that if the attribute contains characters that aren&apos;t allowed in a URI &quot;processors must encode and escape these characters to obtain a valid URI reference&quot;. The Infoset specification then says that the base URI property of the node is the unescaped URI, and after discussion of this test case in the WGs we decided that this unescaped value is also the base URI property of the node in XDM, and hence the value returned by the base-uri() function. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12861</commentid>
    <comment_count>2</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-11-08 13:20:34 +0000</bug_when>
    <thetext>Thank you, Michael, for answer. Yes, I saw previous discussion about this test case, but it had slightly different goal - to escape or not to escape this URI.

Yes, I agree that The XML Base specification does not
require the value of the xml:base attribute to be a valid URI, but function base-uri has return-type equal to xs:anyURI. 

May be I am not right, but I suppose we need to check lexical representation in this case in the same way as if we create xs:anyURI using its constructor.



</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12862</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-11-08 14:16:41 +0000</bug_when>
    <thetext>The data type xs:anyURI is fairly liberal in what it permits. In particular, it allows any string that would be a valid URI if special characters were %-encoded (what I sometimes call a wannabe-URI). I think that the string in this example, although horrible, is a legal instance of xs:anyURI even though it is not a legal URI.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12863</commentid>
    <comment_count>4</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-11-08 15:40:39 +0000</bug_when>
    <thetext>The extent to which an implementation validates the lexical form of xs:anyURI is implementation dependent. I think, it means that if our implementation is strict then we must raise FORG0001 in this test case. 

I don&apos;t insist on making FORG0001 as one possible alternative. But It seems to me that FORG0001 should be allowed as expected result.

If our goal to create non-strict fn:base-uri why we couldn&apos;t return xs:string, not xs:anyURI? 

P.S. Moreover, percent-encoded URI in this test case is not correct URI too according to RFC 2616.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13189</commentid>
    <comment_count>5</comment_count>
    <who name="Carmelo Montanez">carmelo</who>
    <bug_when>2006-12-14 21:24:44 +0000</bug_when>
    <thetext>Ivan:

I do not get your last point.  The returned value is not supposed to be escaped.  The returned values looks ok.  I will mark this as WONTFIX.  Please
re open thsi bug is you still have an issue.

Thanks,
Carmelo</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13190</commentid>
    <comment_count>6</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-14 21:33:18 +0000</bug_when>
    <thetext>Yes I still have an issue. I didn&apos;t say that returned value must be escaped. I said that FORG0001 should be allowed here because &apos;http:\\example.com\\examples&apos; is not in lexical space of xs:anyURI type.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13192</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-12-14 22:05:10 +0000</bug_when>
    <thetext>But, horrible though this string is, it actually *is* in the lexical space of xs:anyURI; that&apos;s because xs:anyURI according to XML Schema allows strings that would be valid URIs if special characters were escaped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13193</commentid>
    <comment_count>8</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-14 22:50:17 +0000</bug_when>
    <thetext>

Ok, if almost any string (possibly, after escaping) is within lexical space of xs:anyURI why we should raise FORG0002 in fn-resolve-uri-3 and moreover in fn-resolve-uri-4 which contains scheme specific invalid URI (as I know &quot;http://&quot; is valid according to general URI syntax)?

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13194</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-12-14 23:26:21 +0000</bug_when>
    <thetext>While it might be true that *almost* any string is permitted by xs:anyURI, it is not true that *every* string is permitted.

fn-resolve-uri-3 uses &quot;:&quot; as a relative URI; that&apos;s illegal according to the syntax in the RFC, and it remains illegal after escaping as described in XLink.

fn-resolve-uri-4 uses &quot;&quot;http://&quot; as an absolute URI; that&apos;s also illegal according to the RFC. The rules are complex, but the essence, I think, is that when the colon is followed by exactly two slashes, then an authority component must be present in the URI.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13195</commentid>
    <comment_count>10</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-14 23:46:27 +0000</bug_when>
    <thetext>fn-resolve-uri-3:
As I understand condition:
&quot;If $relative or $base is not a valid xs:anyURI an error is raised [err:FORG0002]&quot;
from fn:resolve-uri, it means that we should check validness of both arguments without knowledge relative them or absolute.

fn-resolve-uri-4:
&quot;http://&quot; is valid absolute URI according to RFC because authority component can be empty according to the following rules:

...
authority     = server | reg_name
...
server        = [ [ userinfo &quot;@&quot; ] hostport ]
...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13196</commentid>
    <comment_count>11</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2006-12-15 00:21:22 +0000</bug_when>
    <thetext>Fair enough. I was looking at RFC 3986 which has

authority   = [ userinfo &quot;@&quot; ] host [ &quot;:&quot; port ]

host =        IP-literal / IPv4address / reg-name</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13197</commentid>
    <comment_count>12</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-15 00:48:06 +0000</bug_when>
    <thetext>I thought that I should use RFC 2396 as defined by XML Schema Datatypes for xs:anyURI type.

Nevertheless, &apos;host&apos; can be empty in RFC 3986 too.

Moreover what I should do with similar fn-doc queries. Why we have &apos;invalid URI&apos; in fn-doc-17, for example?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13198</commentid>
    <comment_count>13</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-15 00:50:53 +0000</bug_when>
    <thetext>Small addition to previous comment:
&apos;host&apos; can be empty because of reg-name:

reg-name   = *( unreserved / pct-encoded / sub-delims ).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13279</commentid>
    <comment_count>14</comment_count>
    <who name="Ivan Shcheklein">vano_msu</who>
    <bug_when>2006-12-25 23:46:55 +0000</bug_when>
    <thetext>
I think I should close this bug as INVALID - fn-base-uri-23 is correct and other test cases should be considered in other threads.

Thanks, Michael, for the discussion.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>