W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2005

[Bug 1272] 3.7.4 In-scope Namespaces of a Constructed Element looks buggy

From: <bugzilla@wiggum.w3.org>
Date: Tue, 26 Apr 2005 15:26:41 +0000
To: public-qt-comments@w3.org
Message-Id: <E1DQRxR-0000iY-8U@wiggum.w3.org>


------- Additional Comments From jonathan.robie@datadirect.com  2005-04-26 15:26 -------
Let me check my understanding with a few queries.

Example 1:

<e1 xmlns:p="abc">{<e2/>}</e1>//e2

When <e2/> is constructed, the rules of 3.7.4 apply, so <e2/> does
indeed inherit the namespaces of the enclosing element
constructors. When <e2/> is copied into <e1/>, the rules of
apply, so these namespaces are preserved. So the result of the above
query is:

<e2 xmls:p="abc"/>

Example 2:

declare copy-namespaces preserve,no-inherit;
let $e := <e/>
return <ee xmlns:p="abc"><e/>{$e, <e/>}</ee>//*

In the let clause, there is no enclosing element constructor, so the
element does not inherit the xmlns:p binding. The other two do. So the
result is:

<e xmlns:p="abc"/>
<e xmlns:p="abc"/>

Does that match your understanding?

Namespaces are way too complicated in XQuery - this is mostly a
problem for the implementor, rather than the user, but it definitely
makes the language more complex...

Received on Tuesday, 26 April 2005 15:26:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:23 UTC