<?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>4574</bug_id>
          
          <creation_ts>2007-05-22 17:10:34 +0000</creation_ts>
          <short_desc>[UPD] Section 2.4.1/3.1.3 upd:insertInto: Preserve order of inserted sequence</short_desc>
          <delta_ts>2008-05-15 19:51:32 +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>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Rys">mrys</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>15137</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2007-05-22 17:10:34 +0000</bug_when>
    <thetext>Insert into should preserve the order of an inserted sequence. 

Users can always use insert unorder { expr } into target if the order of the inserted sequence should be implementation-dependent.

Proposed change:
&quot;Semantics
The semantics of upd:insertInto are identical to the semantics of upd:insertBefore, except that $target is substituted everywhere for parent($target), and Rule 2a is changed as follows:

The children property of $target is changed to include the nodes in $content. The order among the new children, and their position within the parent node, is implementation-dependent.&quot;

to 

&quot;Semantics
The semantics of upd:insertInto are identical to the semantics of upd:insertBefore, except that $target is substituted everywhere for parent($target), and Rule 2a is changed as follows:

The children property of $target is changed to include the nodes in $content. The new sequence of children is inserted at an implementation-dependent location among the parent node&apos;s children, preserving the sequence and its order.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15140</commentid>
    <comment_count>1</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-05-22 19:25:11 +0000</bug_when>
    <thetext>I am concerned about the proposed phrase &quot;... preserving the sequence and its order.&quot; In general, we cannot guarantee that an inserted sequence will be preserved without interleaving. For example, suppose that one expression inserts the node sequence (A, B) and another expression inserts the node sequence (C, D). If (A, B) is inserted first and the other insertion specifies &quot;into&quot; only, a possible outcome is (A, C, D, B). I do not see any practical way to prevent this. Therefore I think we can claim that order is preserved among the nodes inserted by a single expression, but I do not think we can claim that &quot;the sequence&quot; is preserved (in the sense of protecting it against interleaves).
--Don </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15141</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Rys">mrys</who>
    <bug_when>2007-05-22 20:01:34 +0000</bug_when>
    <thetext>Ok. I agree with into. However I still think as first/as last should not allow interleaving.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15367</commentid>
    <comment_count>3</comment_count>
    <who name="Don Chamberlin">chamberl</who>
    <bug_when>2007-06-11 23:34:34 +0000</bug_when>
    <thetext>Michael,
I believe that this bug report is resolved by the changes that were agreed to in order to resolve Bug 4527. Therefore I have marked this bug report as &quot;Fixed&quot;. Please examine the changes listed under Bug 4527, and if you agree, change the status of this bug report to &quot;Closed&quot;.
Regards,
Don Chamberlin (for the Query Working Group)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>