top-level location-path context dependencies

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 UTC