This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In 2.4.4 clause 2b, a strict reading of the rule If the namespace binding of $QName conflicts with any namespace binding in the namespaces property of the parent (if any) of $target, a dynamic error is raised [err:XUDY0023]. (in conjunction with the referenced definitions) suggests that if the new attribute name has namespace binding (null, null) and the target element has a namespace binding (null, "abc.uri"), then a conflict exists and XUDY0023 is raised. However, this situation is clearly not a conflict, in fact, it is likely to be very common and no trouble at all. I suggest changing the rule to read: If $QName has a non-absent namespace, and if the namespace binding of $QName conflicts with any namespace binding in the namespaces property of the parent (if any) of $target, a dynamic error is raised [err:XUDY0023].
I think this problem is actually rather more pervasive. Consider "rename", where the new name of the element has the namespace binding (null, null) (that is, no prefix, no namespace URI). The current rules imply that the namespace binding (null, null) is added to the namespaces property of the element. However, the namespaces property of an element should never contain such a namespace binding: see the third bullet in XDM 3.3.3: "For every element node whose name has no prefix, the element must have a a binding for the empty prefix to the namespace URI of the element name, or must have no binding for the empty prefix in the case where the name of the element has no namespace URI." That is, the association (null, null) is represented by the absence in the namespaces property of any binding of the form (null, X). So the action of "rename" in such a case should be to remove any namespace binding of the form (null, X). And in practice this is a much more desirable result, because it means that the updated document doesn't carry so many obsolete and no-longer-used namespace bindings.
(In reply to comment #0) > (in conjunction with the referenced definitions) suggests that if the new > attribute name has namespace binding (null, null) and the target element has a > namespace binding (null, "abc.uri"), then a conflict exists and XUDY0023 is > raised. However, this situation is clearly not a conflict, in fact, it is > likely to be very common and no trouble at all. I don't understand why this is no trouble at all. I think you are talking about cases like this: insert node attribute role { "agent" } into <foo xmlns="purple.example.com"/> If role has no prefix, what namespace should it be in? Should it adopt the namespace associated with an absent prefix in the element where it is inserted? Should it retain whatever namespace it had before insertion? I think either answer can lead to some rather confusing scenarios. Jonathan
An attribute with no prefix is always in no namespace.
(In reply to comment #3) > An attribute with no prefix is always in no namespace. > Thanks - my synapses were flapping in the breeze.
The Query Working Group considered this bug report on 20 May 2008, and agreed to make the change suggested by Michael Kay. In addition to the modified rule in Section 2.4.4 clause 2b, we will add the following new rule to Section 3.1.11 (upd:rename) following rule 1b: "If $newname has no prefix and no namespace URI, the namespaces property of $target is modified by removing the binding (if any) for the empty prefix." Since the submitter of this bug report has approved this resolution, I am marking this bug report as Closed. Don Chamberlin (for the Query Working Group)