<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>5313</bug_id>
          
          <creation_ts>2007-12-10 14:07:22 +0000</creation_ts>
          <short_desc>[UPD] Can inserting an attribute replace an existing an attribute?</short_desc>
          <delta_ts>2008-01-15 18:14:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Update Facility</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Andrew Eisenberg">andrew.eisenberg</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>18023</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2007-12-10 14:07:22 +0000</bug_when>
    <thetext>I can&apos;t find any statement in the XQuery Update spec as to whether an &quot;insert&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18026</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-12-10 17:38:31 +0000</bug_when>
    <thetext>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)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18318</commentid>
    <comment_count>2</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2008-01-15 18:14:44 +0000</bug_when>
    <thetext>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 &quot;Closed&quot;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>