[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] General rule for designing XPath expressions to return items in document order?


Subject: Re: [xsl] General rule for designing XPath expressions to return items in document order?
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Thu, 9 Jan 2014 11:07:23 +0000

On 9 January 2014 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 are just seeing oXygen's xpath result presentation there... it's
showing you the first <head>'s immediate text node children, but not
its string value.

If you run that xpath as part of a transform, you'll see you get the
string value of the first <head> (so B A) followed be the string value
of the inner <head> (B).


-- 
Andrew Welch
http://andrewjwelch.com


Current Thread
Keywords