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: Sun, 18 Apr 2004 22:21:45 +0100
To: "'Howard Katz'" <howardk@fatdog.com>, <www-ql@w3.org>
Message-Id: <20040418212157.8BBB4A1CD5@frink.w3.org>

> 
> Any reason you couldn't set the context node to be *any* node within a
> particular document (altho it would likely be a very odd thing to do)?

Saxon allows you to set the context item to any item whatsoever from the
Java API, but the command line interface is more restrictive.

> I think I see it -- maybe. Is the following reasoning correct 
> then?

Without checking your logic in detail against the data files, I think you
have got it right.

Michael Kay


 If the
> environment has set the context item to be the document node 
> for "bib.xml"
> [1], for example, you'd get
> 
> 1) //title => 4 title elements in "bib.xml"
> 2) title => no elements (since no <title> element is child of 
> the context
> item)
> 3) /bib => the root bib element
> 4) bib => ditto
> 
> Similarly if the context item has been set to be the document node for
> "reviews.xml" [2], you'd get
> 
> 1) //title => 3 title elements in "reviews.xml"
> 2) title => no elements (no <title> element is child of the 
> context item)
> 3) /bib => no elements (no <bib> element is at the root of 
> the document
> containing the context node
> 4) bib => no elements (no <bib> element is the child of the 
> context node)
> 
> Howard
> 
> [1] http://www.w3.org/TR/xquery-use-cases/#xmp-data
> [2] http://www.w3.org/TR/xquery-use-cases/#xmp-data-q5
> > >
> > > 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 Sunday, 18 April 2004 17:21:57 GMT

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