This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The XQuery Update specification does not deal with cases when the names of inserted attributes clash. They could clash with each other, or with attributes that already exist. I assume that this should be an error scenario.
Answering as an individual, I believe that we have covered this with a very generic statement in section 3.2.2 upd:applyUpdates, Semantics, bullet 5: "If the resulting XDM instance violates any constraint specified in [XQuery/XPath Data Model (XDM)], a dynamic error is raised [err:XUDY0021]."
I can see how that applies, and missed that on my readings through the spec. However, it might be more user friendly to expand on this statement in places where it applies - such as this case.
I think the suggestion in #2 is sensible. The problem with having a broad statement, although if it correctly covers the conditions, is that it's then up to the reader to figure out where it applies. I believe having more targeted descriptions of error conditions improves the interoperability in these areas, as well as making test-suite creation easier. Perhaps a sensible editorial change is to remove the broad statement(so we don't get overlaps, which is messy even if it's with identical codes) and add a sentence in each specific case it applies.
John, Thanks for your comment, which was discussed by the working group on 13 Feb 2007. The consensus of the working group is that the error of attribute name clashes cannot be detected until applyUpdates time, because the clashing attribute names might have been created by different kinds of expressions (for example, a rename and an insert). So we think that the error is identified in the right place, Rule 5 of upd:applyUpdates. However, we agree that it would be helpful to identify attribute name clashes as a specific example of the rule. Therefore we will add a Note to the next version of the document identifying attribute name clashes as an example of a data model constraint violation, with error code XUDY0021. I hope this change addresses your concern, and I am marking this bug as "Fixed". You may change its status to "Closed" or reopen it if you have additional comments or concerns. Regards, Don Chamberlin (for the Query Working Group)