RE: [xsl] XPath selection using //

Subject: RE: [xsl] XPath selection using //
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Wed, 17 Jul 2002 16:49:11 +0100
>>   Attribute a of the following m is: <xsl:value-of
>>select="following::m/@a"/>
>> </xsl:template>
>>
>>The 'following-sibling' axes will only match nodes of the same depth 
>>of the xml document. 
>
>Somehow I've managed not to see the "following" axis in the
documentation.
>It's working perfectly now.


note there's a big difference between the following:: axis and the
following-sibling:: axis


>'following-sibling' axes will only match nodes of the same depth 

following-sibling will select all the nodes that appear after the origin
node in document order, with the same parent, not nodes of the same
depth in the tree (which could have different parents)

Mike Kays book has some nice diagrams on pages 364-367 (2nd ed) to help
you visualise this

cheers
andrew


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 01/07/2002
 

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


Current Thread