title: XML/XSL to HTML table
body: <p>Can someone help me get the value of the columndefinition/column/cssclass from within my rows loop?</p>
  
  <p>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 &lt;td class="PullItFromColumnDefition"&gt;</p>
  
  <p>Hopefully this makes sense. Can anyone help me figure this out?</p>
  
  <p>Thanks.</p>
  
  <p>My XML looks something like this:</p>
  
  <pre><code>&lt;report&gt;
    &lt;columndefinition&gt;
      &lt;column&gt;
        &lt;headertext&gt;Test Column 1&lt;/headertext&gt;
        &lt;cssclass&gt;test1&lt;/cssclass&gt;
      &lt;/column&gt;
      &lt;column&gt;
        &lt;headertext&gt;Test Column 2&lt;/headertext&gt;
        &lt;cssclass&gt;test2&lt;/cssclass&gt;
      &lt;/column&gt;
    &lt;/columndefinition&gt;
    &lt;rows&gt;
      &lt;row&gt;
        &lt;column&gt;3&lt;/column&gt;
        &lt;column&gt;11/04/2002&lt;/column&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;column&gt;22&lt;/column&gt;
        &lt;column&gt;04/15/2003&lt;/column&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;column&gt;134&lt;/column&gt;
        &lt;column&gt;04/15/2003&lt;/column&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;column&gt;63&lt;/column&gt;
        &lt;column&gt;11/03/2004&lt;/column&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;column&gt;65&lt;/column&gt;
        &lt;column&gt;11/03/2004&lt;/column&gt;
      &lt;/row&gt;
      &lt;row&gt;
        &lt;column&gt;66&lt;/column&gt;
        &lt;column&gt;11/03/2004&lt;/column&gt;
      &lt;/row&gt;
    &lt;/rows&gt;
  &lt;/report&gt;
  </code></pre>
  
  <p>And here is what my xsl currently is:</p>
  
  <pre><code>&lt;xsl:template match="/report"&gt;
    &lt;html&gt;
    &lt;body&gt;
      &lt;h2&gt;Report Sample&lt;/h2&gt;
      &lt;table border="1"&gt;
        &lt;thead&gt;
          &lt;xsl:for-each select="columndefinition/column"&gt;
          &lt;th&gt;&lt;xsl:value-of select="headertext"/&gt;&lt;/th&gt;
          &lt;/xsl:for-each&gt;
        &lt;/thead&gt;
        &lt;tbody&gt;
        &lt;xsl:for-each select="rows/row"&gt;
        &lt;tr&gt;
          &lt;xsl:for-each select="column"&gt;
          &lt;td&gt;&lt;xsl:value-of select="."/&gt;&lt;/td&gt;
          &lt;/xsl:for-each&gt;
        &lt;/tr&gt;
        &lt;/xsl:for-each&gt;
        &lt;/tbody&gt;
      &lt;/table&gt;
    &lt;/body&gt;
    &lt;/html&gt;
  &lt;/xsl:template&gt;
  </code></pre>