RE: [xsl] Axis order and variables

Subject: RE: [xsl] Axis order and variables
From: David Neary <David@xxxxxxxxx>
Date: Fri, 23 May 2003 15:40:10 +0200

De : gutman@xxxxxxxxxxxxxxxx [mailto:gutman@xxxxxxxxxxxxxxxx]
> Consider the following XML
>   <x n="1">
>     <x n="2">
>       <test/>
>     </x>
>   </x>
>         <xsl:variable name="x" select="ancestor::x"/>
>         <xsl:value-of select="$x[1]/@n"/>

> What is the expected result? Is it "1" or "2"?

>   >   The proximity position of a member of a node-set
>   >   with respect to an axis is defined to be the position
>   >   of the node in the node-set ordered in document order
>   >   if the axis is a forward axis and ordered in reverse
>   >   document order if the axis is a reverse axis. 

I think this is pretty clear. The ancestor:: axis is a reverse 
axis (the first ancestor of a node is its parent), therefore 
the expected answer is 2.

Cheers,
Dave.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread