RE: Base URI as used by document

> The XQuery spec section 2.1.1.1 mentions "Base URI" as part 
> of the static context, and that it is used by xf:document.  
> However, it doesn't actually define it.  The Functions and 
> Operator spec says the default base URI is "of the stylesheet 
> element containing the call to the document function".  But 
> what is a "stylesheet element"?  Is it defined anywhere?

This is a cut-and-paste error; the specification of the document() function
was transferred from the XSLT specification. The reference should now be to
the static context. And XQuery needs to define how this variable in the
static context will be initialized (it will probably just say that it's
implementation dependent).


  The 
> only thing I can think of is that it is the uri of the actual 
> XQuery source code.  But this seems rather useless.

Possibly. But it's the normal convention on the web that when one file
contains a reference to another, the reference is considered to be relative
to the file in which the reference was contained. Yes, this makes it
difficult to move files around: which is one reason xml:base was invented.
But of course, an XQuery expression, not being an XML document, cannot take
advantage of xml:base. In practice I think it's most likely that queries
will use absolute URIs.

Thanks for the comment.

Michael Kay

Received on Thursday, 16 May 2002 01:56:46 UTC