Usually a combination of the mod operator and the position() function will help. An easy way:
Code:
<tr class="spec_item_{(position() mod 2)}">
Then you need two CSS classes, spec_item_0 for even rows, spec-item_1 for odd rows.
Alternatively use xsl:call-template, or xsl:function in version 2.0 that returns odd or even:
Code:
<xsl:template name="oddOrEven">
<xsl:param name="position"/>
<xsl:choose>
<xsl:when test="$position mod 2 = 0">even</xsl:when>
<xsl:otherwise>odd</xsl:otherwise>
</xsl:choose>
</xsl:template>
Then do:
Code:
<xsl:for-each select="specifications/row">
<tr>
<xsl:attribute name="class">
<xsl:text>spec_item_</xsl:text><xsl:call-template name="oddOrEven">
<xsl:with-param name="position" select="position()"/>
</xsl:call-template></xsl:attribute>
<td>
<xsl:value-of select="heading"></xsl:value-of>
</td>
<td>
<xsl:value-of select="data"></xsl:value-of>
</td>
</tr>
</xsl:for-each>
--
Joe (
Microsoft MVP - XML)