[DM] MS-DM-LC2-025

Section 2.4	Document Order
Major Editorial/Minor Technical

The general constraints in section 2.4 should be reorganized. A rewrite
proposal below.

For example, bullet 2 does not belong here. It is a description of a
mapping of the XML to the DM and should not be used to describe the DM.
Use Depth-first traveral of the ordered nodes of the tree instead.
Namespace nodes/attribute nodes: remove stable since it says so earlier.
Also define stable to mean on a per query/transformation basis, not for
a persisted data model instance. Add 4.1 All children follow attribute
nodes. Clarify defintion of term "Children": Excludes namespace and
attribute nodes. Remove bullet 5 since it is covered by depth-first
traversal. Add normatively in 2.3 or 2.4 that every node can only appear
once in a tree, but could appear more than once in a sequence. Then it
can be removed in all the subsequent subsections (6.1, 6.2 etc.). Move
general tree constraint "If a node n is a child of a node p, then the
parent of n is p" into 2.4 (maybe rename 2.4 into document structure)
and remove it from later sections.

Here is a proposal:

Somewhere prior to 2.4 (possibly 2.3? or some subsection called
"document structure"), the following concepts must be stated:
 
Each node appears exactly once in exactly one tree.  The same node may
appear multiple times within a sequence.
The children of a node do not include namespace or attribute nodes.  A
node P is the parent of a node N if and only if N is in the children of
P.
 
When describing how XML representations are mapped into the data model,
include this paragraph:
 
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.
 
 
Then change 2.4 to:
 
2.4 Document Order
A document order is defined among all the nodes used during a query or
transformation.  Document order is a total ordering across all nodes
used in a query, although the relative order of some nodes is
implementation-dependent.  Document order is stable, which means that
the relative order of two nodes does not change during the processing of
a given query or transformation, even if this order is
implementation-dependent.  The relative order may change from one query
to the next.
 
Within a tree, document order is the order returned by an in-order,
depth-first traversal of the data model, and satisfies the following
constraints:
 
1. The root node is the first node
2. Namespace nodes immediately follow the element node with which they
are associated.  Their relative order is implementation-dependent.
3. Attribute nodes immediately follow the namespace nodes of the element
with which they are associated. The relative order of attribute nodes is
implementation-dependent.
4. Children follow their parent node.  All children of an element
immediately follow its attributes.
 
Across trees, document order is stable but implementation-dependent.
From the above description, it follows that if any node in a tree T1 is
before any node in a tree T2, then every node in T1 is before every node
in T2.

Received on Monday, 15 December 2003 20:23:17 UTC