RE: selecting similar nodes

Subject: RE: selecting similar nodes
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Wed, 1 Sep 1999 18:04:59 +0100
Perhaps you want something like:

<xsl:for-each select="//ITEM">
  ...
  <xsl:variable name="d" select="descr"/>
  <xsl:for-each select="following-sibling::ITEM[descr=$d]">
     ...
  </xsl:for-each>
</xsl:for-each>

> -----Original Message-----
> From: Sargeant, Richard (GEIS) [mailto:Richard.Sargeant@xxxxxxxxxxx]
> Sent: 01 September 1999 12:08
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: selecting similar nodes
> 
> 
> Hi,
> 
>    I trying to select any following nodes with the same DESCR 
> node but I
> can't quite get it right.
> 
> for example my XML file looks like -
> 
> 	<ITEM>
> 	 	<DESCR>aaaaa</DESCR>
> 		<NUM>1001</NUM>
> 	</ITEM>
> 	<ITEM>
> 	 	<DESCR>aaaaa</DESCR>
> 		<NUM>1002</NUM>
> 	</ITEM>
> 	<ITEM>
> 	 	<DESCR>aaaaa</DESCR>
> 		<NUM>1003</NUM>
> 	</ITEM>
> 	<ITEM>
> 	 	<DESCR>xxxxx</DESCR>
> 		<NUM>1004</NUM>
> 	</ITEM>
> 
> If my current node is 1001,  I want to be able to process 
> 1002, and 1003 at
> the same time. So I thought the following would work...
> 
> 	<xsl:for-each select="from-following(DESCR[text()=text()])">
> 		<xsl:call-template name="Details"/>
> 	</xsl:for-each>
> 
> What am I doing wrong ?
> 
> regards ... Richard
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


Current Thread