W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2007

[Bug 4997] [UPD] Replace of attribute nodes can be ambiguous

From: <bugzilla@wiggum.w3.org>
Date: Fri, 14 Sep 2007 17:18:36 +0000
To: public-qt-comments@w3.org
Message-Id: <E1IWEoO-0000qv-Om@wiggum.w3.org>


------- Comment #1 from chamberl@almaden.ibm.com  2007-09-14 17:18 -------
Hi John,
I believe that the suggested transform expression will succeed. I see nothing
in the update spec to suggest that an error will be raised. Each of the replace
expressions will generate a upd:replaceNode() primitive on the Pending Update
List. Finally upd:applyUpdates() will make these primitives effective, in
either order. The Data Model instance will go through a temporarily invalid
state but the final result is valid and unambiguous. The check for validity of
the XDM takes place in Step 6 of upd:applyUpdates(), at which time the XDM is

In fact, you could even change your example to the following one, in which two
attributes are "swapped":

copy $in := <employee name="Rhys Evans" gender="male"/>
modify (
replace node $in/@name with $in/@gender,
replace node $in/@gender with $in/@name
return $in

This strange and entirely unmotivated expression is not an error. It returns an
<employee> node that is effectively the same as the constructed one, since
order of attributes is not significant.

Don Chamberlin
Received on Friday, 14 September 2007 17:18:52 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:34 UTC