[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Axis order and variables
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|