RE: creation order vs. document order

What Michael points out is that there are two notions of orders for

One is the order of a node within the context of a document. Free
standing nodes do not belong to a node and thus have no real document
order. Since we however have functions such as << that check for
document order, the data model specs says that such nodes have
implementation-dependent but stable document order.

The second kind of order is the sequence order of the result of an
expression. This may or may not be the same as the document order. So if
you say something like:

let $x := (doc("a.xml")/a/b[2], doc("a.xml")/a/b[1])
return $x

then $x[1] precedes $x[2] in the sequence order but follows it in the
document order.

Similarly, if you say

let $y := (<a/>, <b/>)
return $y

then $y[1] precedes $y[2] in the sequence order, but it is
implementation-dependent, how the two elements will fare w.r.t. their


> -----Original Message-----
> From: [] On Behalf
> Jan Hidders
> Sent: Tuesday, September 23, 2003 2:43 PM
> To:
> Subject: Re: creation order vs. document order
> On Tuesday 23 September 2003 21:18, Michael Brundage wrote:
> > ?
> >
> > It is not possible for child nodes to be in anything other than
> > order.
> Well, that is what I'm trying to find out. Can you tell me where in
> formal
> specification it says that? As Torsten and Bas already pointed out,
> Section
> 3.2 of the data model says:
> >> The relative order of free-standing nodes (elements, attributes,
> >> other nodes created outside the context of a particular document)
> >> also implementation-dependent but stable.
> Are you saying that if I create an element with a few children and
> it
> to a variable then I have created those children "in the context of a
> particular document"? Or is the bracketed part not the definition of
> "free-standing" and does free-standing mean "without a parent"?
> -- Jan Hidders

Received on Tuesday, 23 September 2003 17:54:28 UTC