[Bug 3486] [XQuery] relative base URI

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3486


chamberl@almaden.ibm.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Comment #17 from chamberl@almaden.ibm.com  2006-09-26 17:12 -------
On Sept. 26, 2006, the Query and XSLT working groups considered this issue
again. 

We believe that Section 2.1.1, which defines the static context, is not the
correct place to introduce error codes. This section currently defines many
static context items, but has no error codes. By definition, the "base URI"
item in the static context is an absolute URI. It cannot be anything else. The
static context does not specify an error code that applies if "statically known
documents" has the value 47, or if "ordering mode" has the value "Penguin".
These values simply do not correspond to the definitions of their items.

The correct place to introduce error codes is in connection with language
constructs that might cause an error. In the case of Base URI, this language
construct is the Base URI Declaration, described in XQuery Section 4.5. This
section describes in detail how the "base URI" property of the static context
is determined. Here is a quote from this section (in an internal working draft
that has not yet been published):

"In the terminology of [RFC3986] Section 5.1, the URILiteral of the base URI
declaration is considered to be a 'base URI embedded in content'. If no base
URI declaration is present, the base URI in the static context is established
according to the principles outlined in [RFC3986] Section 5.1—that is, it
defaults first to the base URI of the encapsulating entity, then to the URI
used to retrieve the entity, and finally to an implementation-defined default.
If the URILiteral in the base URI declaration is a relative URI, then it is
made absolute by resolving it with respect to this same hierarchy. For example,
if the URILiteral in the base URI declaration is ../data/, and the query is
contained in a file whose URI is file:///C:/temp/queries/query.xq, then the
base URI in the static context is file:///C:/temp/data/. It is not
intrinsically an error if this process fails to establish an absolute base URI;
however, the base URI in the static context is then undefined, and any attempt
to use its value may result in an error [err:XPST0001]."

The working groups believe that this paragraph defines the error behavior
associated with a relative base URI, in the correct context, with a specific
error code.

It may be noted that this paragraph appears only in the XQuery specification
and not in the XPath specification. This is because it is the responsibility of
the host language (XQuery in this case) to specify how the base URI property of
the static context is determined. For the XPath specification, it is sufficient
to state in the definition of the base URI property that it is an absolute URI.

Frans, if you agree with the working groups' analysis of this bug, will you
please change its status to "Closed"?

Regards,
Don Chamberlin (for the Query and XSLT working groups)

Received on Tuesday, 26 September 2006 17:13:15 UTC