RE: XQuery 1.0 - 4.1 Namespace declarations

> -----Original Message-----
> From: Svgdeveloper@aol.com [mailto:Svgdeveloper@aol.com] 
> Sent: 04 March 2003 16:17
> To: public-qt-comments@w3.org
> Subject: XQuery 1.0 - 4.1 Namespace declarations
> 
> 
> 
> The following example, is not totally clear - at least to me.
> 
> declare namespace xx = "http://example.org"
> let $i := <foo:bar xmlns:foo = "http://example.org">
> <foo:bing> Lentils </foo:bing>
> </foo:bar>
> return $i/xx:bing
> 
> The example is intended to illustrate that namespace prefixes 
> need not be 
> identical for two names to match.
> 
> However, I am unclear (I appreciate that 2.5 Variable 
> Bindings is under 
> review) whether $i in the example is intended to bind to the 
> structure <foo:bar xmlns:foo = > "http://example.org"> 
> <foo:bing> Lentils </foo:bing> 
> </foo:bar>
> 
> or only to the outer <foo:bar> element node.
> 

The value of $i is an element node, the <foo:bar> element node, and this
element node has a child <foo:bing> element node, which in turn has a child
text node. You can think of $i as referring to the whole tree rooted at the
<foo:bar> element, but technically the value of the variable is the single
element node at the root of the tree.

Michael Kay

Received on Tuesday, 4 March 2003 19:39:26 UTC