Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   XML (http://www.velocityreviews.com/forums/f32-xml.html)
-   -   Re: Simple xPath. Specyfication lapse? (http://www.velocityreviews.com/forums/t680158-re-simple-xpath-specyfication-lapse.html)

Martin Honnen 04-16-2009 02:13 PM

Re: Simple xPath. Specyfication lapse?
 
szomiz wrote:

> Step 3.1: "child::para", context: <div i="2">
> Result 1: <para i="5">
>
> Ups...


XPath 1.0 expressions return unordered node-sets, see the introduction
in the XPath 1.0 specification:
"The primary syntactic construct in XPath is the expression. An
expression matches the production Expr. An expression is evaluated to
yield an object, which has one of the following four basic types:

* node-set (an unordered collection of nodes without duplicates)

"

So in terms of the XPath 1.0 specification there is no order of the
returned nodes.

If you choose an implementation like MSXML that returns a DOM NodeList
then that implementation has to choose an order. I think with MSXML the
order is document order.

--

Martin Honnen
http://msmvps.com/blogs/martin_honnen/


All times are GMT. The time now is 07:02 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57