[xsl] Selecting a subset of siblings using following-sibling

Subject: [xsl] Selecting a subset of siblings using following-sibling
From: "Liat Jacob" <jacob_liat@xxxxxxxxxxx>
Date: Fri, 23 Nov 2001 18:33:10 +0000

I have an XML file that looks like this:


I need to extract the nodes B through D. I have tried to do this using:

<xsl:for-each select="child::B/following-sibling::*[(name(.) != 'E')]">
  do something here...

but I seem to be getting the nodes B, C, D, F and G (which is not desirable, since I only need nodes B, C and D). I'm not sure if this is the right (read elegant) approach, but I can't figure out another way to select a subset of nodes and define its boundaries (i.e., is it possible to define the boundaries as 'upper' and 'lower' limits with node B being the 'lower' limit and node D the 'upper' limit?).

Thanks in advance for any advice/suggestions.


_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

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

Current Thread