RE: XPath2 questions

"Kay, Michael" <[email protected]> Thu, 6 Mar 2003 20:08:45 +0100
Newsgroups gmane.text.xml.xpath.general
Message-ID <[email protected]>
> 
> I have a few questions relating to an implementation of 
> XPath2.0 and hope this is the correct address for advice.

The preferred address is [email protected], since we found that many
comments related to the family of specs including XPath, XSLT, and XQuery.
> 
> I'd like to better understand how to address the context item 
> focus over a sequence of nodes. For example, given the 
> following input sequence into the expression "//child::mynode" :
> 
> (
>   <mydocA><mynode></mydocA>,
>   <mdocB><mynode></mydocB>
> )

The question is, what is the context node when the expression
//child::mynode is issued? In your example you appear to have a sequence of
two elements, which do not belong to the same document. An expression
starting with "//" selects relative to the root of a document, and (at least
in this case) it will only select nodes in the same document as the context
node.
> 
> Will this return (<mynode>,<mynode>), the child nodes of 
> <mydocA> and <mydocB>?

Not unless these nodes are in the same document.
> 
> Also, in the case of the expression "child::mydocA" operating 
> on the same input sequence, will this result in a singleton 
> sequence of (<mydocA>)? My feeling is that it does, however 
> if this is correct, I'm finding it difficult to conceptualise 
> the notion of a child axis for a sequence of items.

Axes operate only within trees, not within sequences.
> 
> Finally, is there a test suite available or under development 
> for XPath 2.0?
> 

I'm not aware of any coordinated efforts to develop such a suite.

Michael Kay
Software AG