This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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 "if $uri is not castable to xs:anyURI". (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 "MUST" requirement to detect invalid URIs. (d) In any case, it'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
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 "if $uri is not castable to xs:anyURI". 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 "MUST" to "MAY" allowing flexbility of interpreting xs:anyURI differently in different environments and platforms. Erratum E26 will be raised to reflect these decisions.