- From: Ashok Malhotra <ashokma@microsoft.com>
- Date: Fri, 27 Jun 2003 08:14:00 -0700
- To: <public-qt-comments@w3.org>
This is a response from the Functions and Operators taskforce to two related threads referenced in the note below. Please let us know if you are satisfied with this response. All the best, Ashok The comment FO-LC1-0030 [1] by Dave Pawson asked two questions about the fn:doc() function: (a) is the semantics of a zero-length string as the URI being retained? (b) why the change from fn:document()? The first point, about zero-length relative URIs, was picked up in comment FO-LC1-0034 from Kian-Tat Lim. This note responds to both comments, which had lengthy discussion threads associated with them. Taking Dave Pawson's second point first, the reason for introducing fn:doc() in the core function library, and leaving fn:document() as an XSLT-only function, was that it was felt that fn:document() was unnecessarily complex. We decided that for XQuery users, and XPath users outside the XSLT environment, a simpler function was more appropriate. This keeps the full functionality of fn:document() for XSLT users, while providing XPath and XQuery users with a subset of the capability via a different function. The second point about zero-length relative URIs is more complex. The more one reads RFC 2396 [3], 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". (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. We think this note (in G.4) makes it clear that the "current document" and the "base URL" are really the same thing, and that the only distinction is that a user agent is not expected to re-fetch the resource. In our environment this focus on user agents (in effect, web browsers) is inappropriate. The document() and doc() functions *never* refetch a resource (the same URI refers to the same resource throughout the life of a query or transformation). Therefore we believe our interpretation of the RFC, that an empty relative URI refers to the resource identified by the base URI, is correct. 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. [1] http://lists.w3.org/Archives/Public/public-qt-comments/2003May/0154.html [2] http://lists.w3.org/Archives/Public/public-qt-comments/2003May/0209.html [3] http://www.ietf.org/rfc/rfc2396.txt
Received on Friday, 27 June 2003 11:14:10 UTC