Subject: Re: General rule for designing XPath expressions to return items in document order?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 9 Jan 2014 11:13:38 +0000
|
On 9 Jan 2014, at 10:51, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> Hello Martin,
>
> I applied this XPath expression
>
> //head
>
> to this XML document
>
> <Document>
> <head>
> <head>B</head>
> A
> </head>
> </Document>
>
> using oXygen (where SAXON is the XPath processor) and got these results:
>
> A
> B
>
> That is, the results are in non-document order.
>
You've asked for two <head> elements but you haven't said how you want them
displayed; that decision is being made by Oxygen. I don't know why it's
choosing to display the two <head> elements in this way, but it's quite
outside the scope of the XPath specification.
Michael Kay
Saxonica
|