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 definition and examples of the let clause in 3.8.1 doesn't help to 
clarify.

I just wonder if the example needs to be rewritten in two parts.

Andrew Watt

Received on Tuesday, 4 March 2003 11:18:05 UTC