Re: creation order vs. document order

I think the problem that you've identified is that 
the connection between the XQuery data model
and the XQuery formal semantics is not stated clearly 

In the [XQuery 1.0 and XPath 2.0 Data Model], Section 4.3,
there is a set of constraints on element nodes. #3 is
the one that you are looking for:

"Element nodes must satisfy the following constraints.

     1. Every element node must have a unique identity, distinct from
        all other nodes.
     2. The children must consist exclusively of element, processing
        instruction, comment, and text nodes if it is not empty.
        Attribute, namespace, and document nodes can never appear as
     3. The sequence of nodes in the children property is ordered and
        must be in document order. ... etc..."
#3 establishes the relationship between sibling and document order.

In the [XQuery 1.0 and XPath 2.0 Formal Semantics], Section 2.2 gives
a formal notation for the XQuery Data Model, but it _does not_ repeat
the constraints specified in the data model document.  The editors
are working right now to make the relationship between documents
more clear and to identify normative vs. informative text.  I will
make a note to refer to the data model constraints explicitly in 
Section 2.2.

I hope that helps,

On Tue, 2003-09-23 at 19:31, Jan Hidders wrote:
> On Tuesday 23 September 2003 23:54, Michael Rys wrote:
> > What Michael points out is that there are two notions of orders for
> > nodes.
> I'm not sure I understand your point. I know that is what he was trying to 
> point out and I believe I already made clear that I already knew that by 
> asking the follow-up questions that I asked. My comment was that the example 
> that he gave:
> >> let $tree1 := (<x><y/><y/></x>)/y
> >> return $tree1[1] << $tree1[2]
> does not demonstrate that the sibling-order of the two y elements is equal to 
> their document order. Perhaps I'm misunderstanding what he wants to make 
> clear with the example, but otherwise I don't see the point of it.
> Anyway, I still would like to know if it is possible for child nodes in a 
> fragment that is not in a document to have a sibling-order that is different 
> from the document order. Right now the formal semantics seem to say that it 
> can. That surprises me.
> -- Jan Hidders
Mary Fernandez <>
AT&T Labs - Research

Received on Wednesday, 24 September 2003 10:06:28 UTC