M
Matt
I want to produce colors in alternate rows in the table.
The following will produce blue color on every row. So my problem is to figure
out to count the records. If it is odd record, then do <tr bgcolor="blue">,
otherwise, don't do anything, and it will output colors in alternate
rows. I tried to use count, but doesn't work.
Any ideas? Please advise.
<xsl:for-each select="/authors/author">
<tr bgcolor="blue">
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="url"/></td>
</tr>
<authors>
<author>
<name>author1</name>
<url>http://url1.com</url>
</author>
<author>
<name>author2</name>
<url>http://url2.com</url>
</author>
<author>
<name>author3</name>
<url>http://url3.com</url>
</author>
<author>
<name>author4</name>
<url>http://url4.com</url>
</author>
</authors>
The following will produce blue color on every row. So my problem is to figure
out to count the records. If it is odd record, then do <tr bgcolor="blue">,
otherwise, don't do anything, and it will output colors in alternate
rows. I tried to use count, but doesn't work.
Any ideas? Please advise.
<xsl:for-each select="/authors/author">
<tr bgcolor="blue">
<td><xsl:value-of select="name"/></td>
<td><xsl:value-of select="url"/></td>
</tr>
<authors>
<author>
<name>author1</name>
<url>http://url1.com</url>
</author>
<author>
<name>author2</name>
<url>http://url2.com</url>
</author>
<author>
<name>author3</name>
<url>http://url3.com</url>
</author>
<author>
<name>author4</name>
<url>http://url4.com</url>
</author>
</authors>