Hi Wendell (cc @basex-talk),
thanks for your mail. Yes, there are cases in which the result of an axis step are not returned in document order. One such example is shown as follows:
Document Order: <A> <B><c/></B> <c/> </A>//c / parent::node()
No document order (when using the map operator): <A> <B><c/></B> <c/> </A>//c ! parent::node()
I was using parent::node() instead of child::node() here, but the example can surely be adapted to also include a child step.
Hope this helps? Christian ___________________________
On Tue, Dec 10, 2013 at 3:22 PM, Wendell Piez wapiez@wendellpiez.com wrote:
Dear Christian,
Since a path expression consists of "one or more steps" (http://www.w3.org/TR/xquery-30/#dt-path-expression), then isn't 'child::node()' itself a path expression?
I'm not asking to be pedantic. To restate the OP's question, "are there any circumstances in BaseX under which 'child::node()' will return a sequence of nodes not in document order?"
If so, this is easily fixed ... child::node()/. ... but does one ever need to take such care? (In XPath generally, the answer as I understand it would be "no".)
Cheers, Wendell
Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^
On Tue, Dec 10, 2013 at 8:02 AM, Christian Grün christian.gruen@gmail.com wrote:
In BaseX, is the result of the child::node() axis always in document-order ?
The nodes will be in document order if child::node() is part of a path expression (..../....). All the nifty details can be found in the spec [1].
Christian
[1] http://www.w3.org/TR/xquery-30/#id-path-operator _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk