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 5874 - [UPD] Clarification of upd:insertAttributes
Summary: [UPD] Clarification of upd:insertAttributes
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: 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: 2008-07-18 09:05 UTC by Michael Kay
Modified: 2011-01-07 11:38 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2008-07-18 09:05:53 UTC
My reading of the semantics of upd:insertAttributes was that the new attribute is added to the list of attributes of the parent element, even if the parent element already has an attribute of the same name; and at the end of processing the PUL (after processing any delete and rename operations), a consistency error (XUDY0021) is reported if an element has two attributes with the same name at that stage.

However, one of my users came up with a different reading: they thought that upd:insertAttributes would add the new attribute to the parent element, replacing any existing attribute with the same name. Reading the text, this seems to be a legitimate reading, since upd:insertAttributes only says that the attributes property of the parent element is modified to include the new attributes, and does not give any further detail about how that modification is done.

It seems that clarification is needed.
Comment 1 Jonathan Robie 2008-09-23 17:05:19 UTC
We agree with your reading. See in particular the processing model (http://www.w3.org/TR/xqupdate/#id-processing-model) and the consistency constraint check in upd:applyUpdates (http://www.w3.org/TR/xqupdate/#id-upd-apply-updates, see especially point 5).

We don't want to add new conditions to the description of upd:insertAttributes to cover this one consistency constraint that might be detected later in upd:applyUpdates, but we do think it would add clarity to modify this statement:

<old>
attributes: Modified to include the nodes in $content.
</old>

To use the word "add":


<new>
attributes: Modified to add the nodes in $content.
</new>
Comment 2 Michael Kay 2011-01-07 11:38:12 UTC
the PR specification implements the change described in comment #1