I have a problem with following XSL code...

<xsl:template match="sub-section">
 <DIV>
  <xsl:if test="number(/text/sub-section-hilite)">
   <xsl:if test="position() mod 2 = 0">
    <xsl:attribute name="CLASS">subsectionhilite</xsl:attribute>
   </xsl:if>
  </xsl:if>
  <xsl:apply-templates mode="sub-section"/>
 </DIV>
</xsl:template>

It is based on the following code snippet from W3C.

<xsl:template match="item">
 <tr>
  <xsl:if test="position() mod 2 = 0">
   <xsl:attribute name="bgcolor">yellow</xsl:attribute>
  </xsl:if>
  <xsl:apply-templates/>
 </tr>
</xsl:template>

My problem is that the test="position() mod 2 = 0" evaluates to true all 
the time.

My XML has more than 1 "sub-section" node (common parent) and is well 
formed.

Any suggestions?

Is "mod" implemented?

sabcmd --version returns: sabcmd 0.51 (February 19, 2001)

-- 
Stephen.

Reply via email to