RE: top-level location-path context dependencies

"Michael Kay" <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
> Howard Katz wrote:
> > 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)?
> 
> Why not allow it to be a *sequence* of nodes, is the better question.
> 
> It's much nicer if //foo would match all foo's within the 
> default set of 
> documents.
> 

Replacing the concept of "context item" by one of "context sequence" (or
"default set of documents") would create mayhem: what would context position
and context size then be, for example? Would "." also return a sequence?
Would id() search multiple documents, perhaps finding multiple elements with
the same ID? What would the query name(/*) do?

If //x were able to return nodes from multiple documents when used at the
top level of a query, then presumably you would also want it to be able to
do the same when used at other levels (for composability). What new XQuery
construct would you want to introduce for setting the context sequence?

I agree that it's a pity (from the XQuery point of view) that input() has
gone. It never made much sense in XPath or XSLT, but I don't see any reason
why there shouldn't be XQuery-only functions just as there are XSLT-only
functions.

Michael Kay
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.