W3C home > Mailing lists > Public > www-ql@w3.org > April to June 2004

RE: top-level location-path context dependencies

From: Michael Kay <mhk@mhk.me.uk>
Date: Sat, 17 Apr 2004 22:50:07 +0100
To: "'Howard Katz'" <howardk@fatdog.com>, <www-ql@w3.org>
Message-Id: <20040417215021.E0D89A08C9@frink.w3.org>

> I'm trying to understand the ways in
> which implementations can effect the settings of the 
> top-level context item,
> as outlined in "C.2 Dynamic Context Components" in the main 
> XQuery document> [1].

The expectation is that implementations are likely to provide an API
allowing the context item to be initialized. In Saxon, for example, the
XQueryExpression#evaluate() method takes an argument of type
DynamicQueryContext, and the DynamicQueryContext object has a method
setContextItem() or setContextNode(). If invoked from the command line, the
initial context item can be set to the document node of an XML document
using the option "-s source.xml".
> 
> To be more specific, assuming a two-document context ("bib.xml" and
> "reviews.xml" from the use cases),

You're using the term "context" loosely there, I think. The context item is
always a single item. There is no such thing as a "two-document context".

> what are the results of 
> the following
> top-level queries? And which of these depends on the 
> particular environment
> and which are never dependant on the environment?

All of these queries return nodes from the document that contains the
context node. In all cases the result nodes all come from the same document,
and in all cases they depend on the way the context was initialized. If the
context has not been initialized, they throw an error.
> 
> It would be very useful to me if somebody could show the 
> above results in a tabular fashion

No table needed: there is no difference between these four cases.

Michael Kay 
Received on Saturday, 17 April 2004 17:50:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 22 July 2006 00:10:19 GMT