RE: ORA-XQ-282-B: sort order of results of a step expression

> 
> SECTION 3.2: Path expressions
> 
> It says in the third paragraph after rule [70] that
> "Each operation E1/E2 is evaluated as follows:
> expression E1 is evaluated... The sequence of nodes resulting 
> from all evaluations of E2 are combined, eliminating duplicate nodes 
> based on node identity and sorting the result in document 
> order". Later, in section 3.2.1 "Steps", in the last 
> paragraph prior to the final note, it says "If the axis is a 
> reverse axis, context positions are assigned in reverse 
> document order."  These two sentences 
> appear to be in contradiction.  Either reverse axes result in 
> a sequence that is in forward document order, or the general 
> statement in 3.2 should say that the result is in either 
> forward or reverse document order.
> 

This situation (which is unchanged from XPath 1.0) has always been
confusing, but I think we describe it more clearly now than we did in
XPath 1.0, and the statements are not contradictory. The expression
ancestor::X[P] delivers nodes in document order, but within P, the
positions of the nodes are counted in reverse document order.

Michael Kay

Received on Monday, 16 February 2004 18:05:44 UTC