I have a xml doc with around 150 entries. I am sorting the entries in several fashions. One is alphabetical, which is displayed via XSLT and works perfectly, the others are by category and solution, which have issues with alternating banding color by row.
The problem arises when I iterate over entries that are not being displayed, it seems that they are being included in the count even though they are not being displayed. I asked this question once before under an anonymous user, hopefully I am clearer this time.
Thanks for the help.
XML Doc.
<case-studies>
<!-- #### X #### -->
<case-study>
<name>Entry 1</name>
<category solution="Performance">Medical</category>
<category solution="Medical">Security</category>
<category solution="Industry">Medical</category>
<category solution="A-Z">X</category>
</case-study>
<!-- #### Y #### -->
<case-study>
<name>Entry 2</name>
<category solution="Industry">Education</category>
<category solution="Convergence">Education</category>
<category solution="A-Z">Y</category>
</case-study>
</case-studies>
XSLT Call
<%
Dim mm_xsl As MM.XSLTransform = new MM.XSLTransform()
mm_xsl.setXML(Server.MapPath("/data/xml/case-studies/case-studiesTest.xml"))
mm_xsl.setXSL(Server.MapPath("/data/xslt/case-studies/categoryLandingOther.xsl"))
mm_xsl.addParameter("solName", "Industry")
mm_xsl.addParameter("catName", "Business services")
Response.write(mm_xsl.Transform())
%>
Portion of xslt
<xsl:for-each select="case-studies/case-study/category[. = $catName]">
<!--xsl:sort select="../name" /-->
<xsl:if test="@solution[. = $solName]">
<tr>
<xsl:if test="(position() mod 2 = 1)">
<xsl:attribute name="bgcolor">#e7e7e7</xsl:attribute>
</xsl:if>
<td class="cell1">
</td>
<td class="cell2" style="padding-top:2px;">» <a href="{../url}"><xsl:value-of select="../name"/></a></td>
<td class="cell3">
<xsl:for-each select="../solutionType">
<div class="clearRight"><xsl:value-of select="."/></div>
</xsl:for-each>
</td>
</tr>
</xsl:if>
</xsl:for-each>