This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5313 - [UPD] Can inserting an attribute replace an existing an attribute?
Summary: [UPD] Can inserting an attribute replace an existing an attribute?
Status: CLOSED INVALID
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-10 14:07 UTC by Michael Kay
Modified: 2008-01-15 18:14 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2007-12-10 14:07:22 UTC
I can't find any statement in the XQuery Update spec as to whether an "insert" operation that inserts an attribute node can replace an existing attribute of the same name, or whether it fails with some dynamic error if an existing attribute of the same name already exists.
Comment 1 Don Chamberlin 2007-12-10 17:38:31 UTC
My interpretation is as follows:
(1) The Insert expression generates an upd:insertAttributes primitive on the Pending Update List (PUL). (See Section 2.4.1)

(2) At the end of the snapshot, upd:applyUpdates is invoked, causing the upd:insertAttributes primitive to be applied. At this moment, the parent element has two attributes with the same name. (See Section 3.1.6)

(3) In Step 5 (formerly Step 6) of upd:applyUpdates, the XDM instance is checked for violation of data model constraints. Two attributes with the same name and parent violate a data model constraint, so the query terminates with XUDY0021. Since updates are applied atomically, the resulting XDM is unchanged. (See Section 3.2.2)

Regards,
Don Chamberlin (speaking for myself)
Comment 2 Don Chamberlin 2008-01-15 18:14:44 UTC
On 15 Jan 2008 the working group considered this bug report and decided that the existing specification is sufficiently clear. Since the submitter was present at the discussion, I am marking this bug report as "Closed".