<?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>5688</bug_id>
          
          <creation_ts>2008-05-14 11:03:04 +0000</creation_ts>
          <short_desc>[FO] doc(), doc-available(), and invalid URIs</short_desc>
          <delta_ts>2008-06-04 11:16:59 +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 NT</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>20091</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-05-14 11:03:04 +0000</bug_when>
    <thetext>The summary of both doc() and doc-available() states:

If $uri is not a valid xs:anyURI, an error is raised [err:FODC0005].

(a) The function signature allows the argument to be an empty sequence. A literal reading suggests that if an empty sequence is supplied, the function should raise FODC0005, because the empty sequence is not a valid xs:anyURI. 

For doc(), the spec goes on to clarify this by saying that if $uri is (), the function returns (). But there is no corresponding statement for doc-available(). I find it hard to believe that an error was intended; it seems to me that the expectation is to return false in this case.

There are other problems with the sentence. 

(b) The argument $uri is of type xs:string, so it can never be a valid xs:anyURI; the intent I think is &quot;if $uri is not castable to xs:anyURI&quot;.

(c) The rules for the value space of xs:anyURI are notoriously fuzzy, and many implementations exploit this by allowing things that are not strictly URIs, for example Windows file names or jar: scheme URLs. XML Schema 1.1 recognizes this by making the value space of xs:anyURI the same as xs:string. I think we should acknowledge reality by removing the implicit &quot;MUST&quot; requirement to detect invalid URIs.

(d) In any case, it&apos;s not clear that the user is well-served by having doc-available() throw an error - though that observation in itself does not justify an erratum.

Arose from consideration of test K2-SeqDocAvailableFunc-1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20371</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-06-04 10:51:48 +0000</bug_when>
    <thetext>The WG considered this bug at its meeting on 20 May 2008. The resolution was as follows:

(a) doc-available() should return FALSE if the argument is an empty sequence.

(b) The argument $uri is of type xs:string, so it can never be a valid
xs:anyURI; the intent I think is &quot;if $uri is not castable to xs:anyURI&quot;. Accepted as an editorial change.

(c) The rules for the value space of xs:anyURI are notoriously fuzzy, 
and many implementations exploit this by allowing things that are not strictly 
URIs: Resolved to change &quot;MUST&quot; to &quot;MAY&quot; allowing flexbility of interpreting xs:anyURI differently in different environments and platforms.

Erratum E26 will be raised to reflect these decisions.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>