RE: [XQuery] IBM-XQ-018: Copying namespace nodes

D>(IBM-XQ-018) Section 3.7.1.3, Direct Element Constructors--Content:
This section says that element nodes that are copied by an element
constructor retain their namespace nodes. This seems to imply that the
copied nodes do not also inherit namespace nodes from their new parent.
Is this correct? 

MK> Yes, that's my understanding of the current spec. I do have some
anxieties about it, expressed in 
http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/0128.html

The analysis I did there suggests that we may be depending rather too
heavily on serialization (as XML 1.0) adding the required namespaces
back in, and that when you serialize as XML 1.1, you are going to get a
lot of namespace undeclarations, which will often be a waste of ink. It
also raises the problem that we invoke serialization as part of the
validation process, and we will need to define whether this is 1.0 or
1.1 serialization; and of course it can't be 1.1 serialization until XML
Schema supports XML 1.1. But if we change the rule so that namespaces
are inherited, then we need to think about some other mechanism for
generating a namespace undeclaration.

DC>If so, the copied node may have fewer namespace nodes than its
parent. How can such a node be serialized? Does this introduce a
dependency on "undeclaration" of namespaces, supported only by
Namespaces 1.1? 

MK>The serialization can cope with it, but I think there are wider
problems. The rules are that if you serialize as 1.0, the namespaces
don't get undeclared, which means you don't get perfect round-tripping.

DC>Similarly, in Section 3.7.4, Namespace Nodes on Constructed Elements:
Suppose that the namespace prefix "a" is defined in the Static Context.
Suppose that a constructed parent element has an attribute named "a:b"
but its constructed child element does not use the prefix "a" in any
name. According to the rules in this section, the parent element will
get a namespace node for "a" but the child will not. Again, how can
these elements be serialized? Is this another dependency on Namespaces
1.1? 

MK>I think you're just restating the same problem, or have I
misunderstood?

Michael Kay

--Don Chamberlin

Received on Tuesday, 17 February 2004 09:29:09 UTC