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 4527 - [UPD] Sections 2.4.1 insert/3.1.3 upd:insertInto
Summary: [UPD] Sections 2.4.1 insert/3.1.3 upd:insertInto
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: P2 critical
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: 4528
  Show dependency treegraph
 
Reported: 2007-05-04 23:23 UTC by Michael Rys
Modified: 2008-05-15 19:39 UTC (History)
0 users

See Also:


Attachments

Description Michael Rys 2007-05-04 23:23:16 UTC
The spec currently says: "If multiple nodes are inserted before or after in the same snapshot, the ordering among these nodes is implementation-dependent."

There are two such cases:
==> do insert (a,b,c) before d should preserve order of a b c

(do insert a before d), (do insert b before d) should be implementation-dependent.

If implementation environment such as XML views over relational data models cannot preserve the order in the first case, they already have other order related issues and should deal with them in general and not just for insert.
Comment 1 Don Chamberlin 2007-06-11 23:19:55 UTC
Michael,
The Query Working Group considered this bug report on June 5, 2007 and agreed to make the following changes to the XQuery Update specification:

In Section 2.4.1 (Insert), replace the first three bullets with the 
following three bullets, each of which has multiple sub-bullets:

* If before (or after) is specified:
- The inserted nodes become the preceding (or following) siblings of the 
target node. 
- If multiple nodes are inserted by a single insert expression, the nodes 
remain adjacent and their order is preserved. 
- If multiple groups of nodes are inserted by multiple insert expressions 
in the same snapshot, adjacency and ordering of nodes within each group is 
preserved but ordering among the groups is implementation-dependent.

* If as first into (or as last into) is specified:
- The inserted nodes become the first (or last) children of the target 
node.
- If multiple nodes are inserted by a single insert expression, the nodes 
remain adjacent and their order is preserved.
- If multiple groups of nodes are inserted by multiple insert expressions 
in the same snapshot, adjacency and ordering of nodes within each group is 
preserved but ordering among the groups is implementation-dependent.

* if into is specified without as first or as last:
- The inserted nodes become children of the target node.
- If multiple nodes are inserted by a single insert expression, their 
order is preserved.
- The positions of the inserted nodes will be chosen so as not to interfere with the intended positions of nodes that are inserted with the specification before, after, as first, or as last. For example, If node B is inserted "after node A", no other node may be inserted between nodes A and B unless it is also 
inserted "after node A".
- Subject to the above constraints, the positions of the inserted nodes 
among the children of the target node are implementation-dependent. 

================
In Section 2.4.1 (Insert), in semantic Rules 5a and 5b, replace "as first" 
by "as first into" and replace "as last" by "as last into".

================
In Section 3.1.3 (upd:insertInto), under "Semantics", replace the bullet 
with the following:

* The children property of $target is changed to include the nodes in 
$content in implementation-dependent positions, preserving their order.


If you are satisfied with this resolution of this bug report, please change its status to "Closed".

Regards,
Don Chamberlin (for the Query Working Group)