Re: creation order vs. document order

Michael Brundage wrote:

> The data model defines three concepts:  documents, fragments, and sequences.
> You're mixing up the latter two.
> (There is no such thing as "sibling order".)

Actually that's a pretty standard term in mathematics when talking about 
ordered trees, but since for documents and fragments this order is 
defined by the document order you are absolutely right that the question 
"can the sibling order be different from the document?" is nonsensical 
because the answer is "no, by definition this is impossible".  That's 
what you and Michael Rys have been trying to tell me all along, and it 
took me reading your explanation, a good night sleep and some browsing 
through the formal semantics to realize this. So I owe you two 
apologies, one for wasting your time, and one for wrongly claiming that 
your example was not relevant, and a very big "thank you" for your 
elaborate explanation.

But now I'm still left with the following question. Is the semantics of 
the following expression well defined in the formal semantics?

    (<x><y id="1"/><y id="2"/></x>)/y

As far as I can tell there are two possible results:

   <y id="1"/><y id="2"/>   or    <y id="2"/><y id="1"/>

The reason why I think this is as follows: When the the two y elements 
are created for the first time their relative order (in document order) 
is application-dependent. When they are copied by the function 
fs:item-sequence-to-node-sequence it, as far as I can see, is not 
specified (see 
http://www.w3.org/TR/2003/WD-xquery-20030502/#id-computedElements ) that 
the the copies of the items should be ordered relatively in document 
order as the original items were ordered in the input item sequence.  So 
if the input item sequence was <n1, n2> with n1 and n2 element nodes 
then the copy of n1 should precede (in document order) the copy of n2. 
This should even be true if n2 precedes n1 in document order.

So, am I correct that something is missing here in the formal semantics?

-- 
    Jan Hidders

  .---------------------------------------------------------------------.
  | Post-doctoral researcher               e-mail: jan.hidders@ua.ac.be |
  | Dept. Math. & Computer Science         tel: (+32) 3 218 08 73       |
  | University of Antwerp                  fax: (+32) 3 218 07 77       |
  | Middelheimlaan 1, BE-2020 Antwerpen, BELGIUM     room: G 3.21       |
  `---------------------------------------------------------------------'

Received on Wednesday, 24 September 2003 05:48:49 UTC