Can someone help me get the value of the columndefinition/column/cssclass from within my rows loop?
So, in my xsl, I want to pull in the cssclass for the same column position during my "rows" forloop, and put it into my <td class="PullItFromColumnDefition">
Hopefully this makes sense. Can anyone help me figure this out?
Thanks.
My XML looks something like this:
<report>
<columndefinition>
<column>
<headertext>Test Column 1</headertext>
<cssclass>test1</cssclass>
</column>
<column>
<headertext>Test Column 2</headertext>
<cssclass>test2</cssclass>
</column>
</columndefinition>
<rows>
<row>
<column>3</column>
<column>11/04/2002</column>
</row>
<row>
<column>22</column>
<column>04/15/2003</column>
</row>
<row>
<column>134</column>
<column>04/15/2003</column>
</row>
<row>
<column>63</column>
<column>11/03/2004</column>
</row>
<row>
<column>65</column>
<column>11/03/2004</column>
</row>
<row>
<column>66</column>
<column>11/03/2004</column>
</row>
</rows>
</report>
And here is what my xsl currently is:
<xsl:template match="/report">
<html>
<body>
<h2>Report Sample</h2>
<table border="1">
<thead>
<xsl:for-each select="columndefinition/column">
<th><xsl:value-of select="headertext"/></th>
</xsl:for-each>
</thead>
<tbody>
<xsl:for-each select="rows/row">
<tr>
<xsl:for-each select="column">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
</tbody>
</table>
</body>
</html>
</xsl:template>