W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2002

RE: Base URI as used by document

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Mon, 20 May 2002 15:18:10 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E6210602679DCC@daemsg02.software-ag.de>
To: Per Bothner <per@bothner.com>, "Kay, Michael" <Michael.Kay@softwareag.com>
Cc: public-qt-comments@w3.org
> > 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.
> 
> But it is *not* the source file that contains the reference. 
> The filename is an expression that is calculated at run-time. 
> And the normal convention for when a filename is calculated 
> at run-time, then the reference is relative to the current 
> *run-time* context (directory).

The spec for the document() function distinguishes the case where the
argument is a string from the case where it is a node. In the first case,
the base URI is taken from the static context, in the second case, it is the
base URI of the node containing the relative URI. The first case is designed
primarily for the situation where the value is a string literal. In the case
of a computed string, you can select an alternative base URI by supplying
the second parameter to the document() function. This, I think, was designed
to enable you to supply a run-time base URI. Perhaps the spec should be
refined so that the second argument is also allowed to be a string, rather
than necessarily a node.
> 
> Which of course is difficult because there is no convenient 
> way for an application to get an absolute url from the 
> execution environment - i.e. no way reasonable way to get a 
> string parameter from the environment.  I suggested way to do 
> that in the posting "Variable Declaration in Query Prolog" 
> from March 
>
(http://lists.w3.org/Archives/Public/www-xml-query-comments/2002Mar/0007.htm
l).
> I was disappointed to not get a response of this, since I think this is an
essential 
> feature for practical use of XQuery.

I think there is a good argument for allowing a query to take parameters, in
the same way as stylesheets can. On the other hand, there is an alternative
argument that a query with parameters is no different from a function, and
if you want this capability the right way to provide it is to allow the API
to invoke an XQuery function directly.

Michael Kay
Received on Monday, 20 May 2002 09:18:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:22 GMT