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

top-level location-path context dependencies

From: Howard Katz <howardk@fatdog.com>
Date: Sat, 17 Apr 2004 11:47:44 -0700
To: <www-ql@w3.org>
Message-ID: <IKEOLCDFPBBPPAHGNKKOCEJGEKAA.howardk@fatdog.com>

I have a question regarding top-level contexts for location paths. it used
to be the case it wasn't necessary to root a query in a particular data
source, using doc() or collection(), if the data source was known to the
environment. Is that still the case? 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].

To be more specific, assuming a two-document context ("bib.xml" and
"reviews.xml" from the use cases), 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?

1) //title (<title> elements found in both documents)

2) title

3) /bib (root element <bib> exists only in the "bib.xml" document)

4) bib

I can see three possible results in each case:

(a) query errors with an XP0002: "some part of the dynamic context has not
been set"
(b) query returns a null sequence
(c) query returns a sequence of one or more element nodes

Are any other error conditions possible?

It would be very useful to me if somebody could show the above results in a
tabular fashion something like the following (for example):

1) (a) or (b), dependent on the implementation
2) (c), not implementation-dependent
3)  etc etc ...

Thanks!
Howard

[1] http://www.w3.org/TR/xquery/
Received on Saturday, 17 April 2004 14:46:43 GMT

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