Subject: Realising when you hit the last match?
From: "Aaron McGrath" <aaronmcgrath@xxxxxxxxxxx>
Date: Fri, 04 Mar 2005 10:50:29 +0000
|
-> Normally I use for-each and a test on the position:
->
-> <xsl:template match="/">
-> <xsl:for-each select="//heading[@class='2000'] |
-> //heading[@class='2003'] | //heading[@class='2008'] |
-> //heading[@class='2009']">
-> <xsl:apply-templates select="."/>
-> <xsl:if test="position() != last()">,</xsl:if>
-> <xsl:text>
</xsl:text>
-> </xsl:for-each>
-> </xsl:template>
->
-> <xsl:template match="heading">
-> <xsl:value-of select="@class"/>
-> </xsl:template>
Thanks Pete! Worked very nicely!
|