Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT: Determing odd or even node count

Status
Not open for further replies.

JoeMcGarvey

Programmer
Oct 31, 2002
47
US
Hi there....
Can anyone point me in the right direction here...

I am trying to write an xsl:if statement that checks if the node count is odd or even. If it is odd (say 1 or 3) it writes:

<tr><td>STUFF</td>

If it is even (say 2 or 4) it writes:

<td>STUFF</td></tr>

The result is a table with two <td>'s per row.

If anyone is familiar with the Mod function in VB, that's what I want to accomplish.

Thanks for any help!!
 
Got my answer...

<xsl:when test=&quot;position() mod 2 = 1&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top