[DM] Document order of element's attributes and children

In the data model document, the relative document order between
an element's attributes and children is not specified, which 
causes the definition of the following:: axis ambiguous.

In XPath 1.0 (http://www.w3.org/TR/xpath#data-model), an element's
attributes precede its children:

  "The attribute nodes and namespace nodes of an element occur before 
   the children of the element."

The above constraint is missing from the definition
of document order in the XPath 2.0 data model 
(http://www.w3.org/TR/xpath-datamodel/#document-order):


     "Within a tree, document order satisfies the following constraints:

     1. The root node is the first node.
        
     2. The relative order of siblings is determined by their order in
        the XML representation of the tree. A node N1 occurs before a
        node N2 in document order if and only if the start of N1 occurs
        before the start of N2 in the XML representation.
        
     3. Namespace nodes immediately follow the element node with which
        they are associated. The relative order of namespace nodes is
        stable but implementation-dependent.
        
     4. Attribute nodes immediately follow the namespace nodes of the
        element with which they are associated. The relative order of
        attribute nodes is stable but implementation-dependent.
        
     5. Element nodes occur before their children; children occur before
        following-siblings."
        
Also the statement in point 5 above that "children
occur before following-siblings" is circular: The definition of the
following-sibling axis depends on document order, so the definition of
document order can't depend on the following-sibling axis.  Moreover,
the data model should not mention axes at all as they are expressions
in the XPath 2.0 language, not a construct in its data model.

Mary Fernandez with help from Michael Rys and Michael Kay
-- 
Mary Fernandez <mff@research.att.com>
AT&T Labs - Research

Received on Wednesday, 10 March 2004 12:07:04 UTC