Re: FO-LC1-0034 (resolve:uri)

Ashok Malhotra wrote:
> This response is to messages that you sent to the public comments list.
>> The second point about zero-length relative URIs is more complex. The  
>> more one reads RFC 2396 [1], the more one becomes aware of its  
>> limitations. In this case there seem to be two problems with the text  
>> in the RFC:
>>
>> (a) the grammar given in section 5 for a relative URI does not allow  
>> the use of a zero-length string as a relative URI, yet the algorithm  
>> for resolving relative URIs in section 5.2 appears to attach  
>> semantics to this case: "it is a reference to the current document  
>> and we are done." (Note the informality of the language.) Appendix C  
>> confirms this interpretation: "An empty reference refers to the start  
>> of the current document".

While the grammar in section 5 for a relativeURI does not
allow a zero-length string, the grammar in section A makes
clear that a URI-reference can be empty, since absoluteURI,
relativeURI, and "#" fragment are all optional.  A zero-length
string is thus not a relative URI, but it is a URI reference.

Section 5.2 talks about resolving URI references that
*might* (emphasis mine) be relative to a given base URI, hence
the presence of step 3 in the algorithm, which handles
absolute URIs.  This is not an algorithm that only handles
relative references, despite the title of the section, and
it is thus appropriate for it to handle the empty URI reference
as one of its cases.

>> (b) Both these descriptions of the semantics of an empty relative URI  
>> use the term "current document", which is not defined anywhere in the  
>> RFC. The best explanation of the term seems to be in section G.4:
>>
>> <quote>
>>>    RFC 1808 (Section 4) defined an empty URL reference (a reference  
>>> containing nothing aside from the fragment identifier) as being a  
>>> reference to the base URL.  Unfortunately, that definition could be  
>>> interpreted, upon selection of such a reference, as a new retrieval  
>>> action on that resource.  Since the normal intent of such references  
>>> is for the user agent to change its view of the current document to  
>>> the beginning of the specified fragment within that document, not to  
>>> make an additional request of the resource, a description of how to  
>>> correctly interpret an empty reference has been added in Section 4.
>>> </quote>
>>>
>> We think this reference to section 4 must be intended to point to  
>> section 5.2.

The term "current document" is in fact used in section 4.2,
as I mentioned in [2], so the pointer in Appendix G is correct.
Section 4.2 explicitly says that an empty URI reference within
a document is interpreted as a reference to the start of that
document (regardless of base URI), *unless* the URI reference
occurs in a context that is always intended to result in a new
request.  Since "the document() and doc() functions *never*
refetch a resource" (emphasis yours), the "unless"/"however"
clause does not apply.

>> Therefore we believe our interpretation of the RFC, that an empty  
>> relative URI refers to the resource identified by the base URI, is  
>> correct.

I continue to disagree with this statement in this context.

>> Nevertheless, we intend to change the wording of our specification so  
>> that any attempts to interpret the language of the RFC are in  
>> non-normative notes. The text of the RFC, for all its informality,  
>> will therefore be the normative definition.

This is sufficient to satisfy my objections, though I remain
concerned that differing interpretations of the RFC, as
demonstrated in this thread, may be a source of interoperability
problems in the future.

[1] http://www.ietf.org/rfc/rfc2396.txt

[2]  
http://lists.w3.org/Archives/Public/public-qt-comments/2003May/0216.html

-- 
Kian-Tat Lim, ktl@ktlim.com, UTF-7: +Z5de+pBU-

Received on Saturday, 28 June 2003 20:42:30 UTC