XSLT - HTML table problem
Hi,
I'm having a real problem with trying to get my xslt stylesheet to produce a html table.
I want the table to look something like the following:
_________________________________________
|radio-button description | radio-button description |
|radio-button description | radio-button description |
|_________________________________________|
So that each table row has the following:
<tr><td>radio-button</td><td>decsription</td>
<td>radio-button></td><td>description</td></tr>
The code in the stylesheet is as follows:
<CODE>
<xsl:template match="table-RdbDataOptions2" >
<!-- Add the data options and user info -->
<table width="100%" border="0" align="left">
<xsl:for-each select="td">
<tr>
<td colspan="2">
<xsl:choose>
<xsl:when test="position()=1">
<div align="left" class="subheading"><xsl:value-of select="." /></div>
</xsl:when>
<xsl:when test="position()=2">
<div align="left"><xsl:value-of select="." /></div>
</xsl:when>
</xsl:choose>
</td>
</tr>
</xsl:for-each>
<!-- now build a 2x row/2x cell table-->
<xsl:for-each select="rdb-DataOption">
<xsl:choose>
<xsl:when test="not(@recfav='')">
<xsl:choose>
<!-- when an uneven number, start a new table row. Add unevens to this row -->
<xsl:when test="position() mod 2=1">
<tr>
<xsl:choose>
<xsl:when test="@dataseriescheck=''">
<td> <input type="radio" name="rdbDataOptions" value="series" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td> <input type="radio" name="rdbDataOptions" value="series" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
<xsl:when test="@aggregatecheck=''">
<td> <input type="radio" name="rdbDataOptions" value="aggregate" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td><input type="radio" name="rdbDataOptions" value="series" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:when><!-- end of test position() mod 2 = 1 -->
<xsl:otherwise><!-- Add new row for even numbers -->
<tr>
<xsl:choose>
<xsl:when test="@cummulativecheck=''">
<td> <input type="radio" name="rdbDataOption" value="cummulative" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td><input type="radio" name="rdbDataOption" value="cummulative" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
<xsl:when test="@averagecheck=''">
<td><input type="radio" name="rdbDataOption" value="Average" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td><input type="radio" name="rdbDataOption" value="Average" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:otherwise><!-- end of adding new row for even numbers -->
</xsl:choose>
</xsl:when>
</xsl:choose><!-- end of check for not recents -->
<xsl:otherwise><!-- Recent -->
<xsl:choose>
<!-- when an uneven number, start a new table row. Add unevens to this row -->
<xsl:when test="position() mod 2=1">
<tr>
<xsl:choose>
<xsl:when test="@dataseriescheck=''">
<td><input type="radio" name="rdbDataOptions" value="series" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td> <input type="radio" name="rdbDataOptions" value="series" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
<xsl:when test="@aggregatecheck=''">
<td><input type="radio" name="rdbDataOptions" value="aggregate" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td><input type="radio" name="rdbDataOptions" value="series" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:when><!-- end of test position() mod 2 = 1 -->
<xsl:otherwise><!-- Add new row for even numbers -->
<tr>
<xsl:choose>
<xsl:when test="@cummulativecheck=''">
<td><input type="radio" name="rdbDataOption" value="cummulative" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td> <input type="radio" name="rdbDataOption" value="cummulative" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
<xsl:when test="@averagecheck=''">
<td><input type="radio" name="rdbDataOption" value="Average" disabled="disabled"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:when>
<xsl:otherwise>
<td><input type="radio" name="rdbDataOption" value="Average" disabled="disabled" checked="checked"/></td>
<td><div align="left"><xsl:value-of select="." /></div></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:otherwise><!-- end of adding new row for even numbers -->
</xsl:choose>
</xsl:otherwise>
</xsl:for-each>
</table>
</xsl:template>
</CODE>
The jsp creates the table in the following way:
<CODE>
<table-RdbDataOptions2>
<td><%=Lang.get("DataOptions", User.getPrimary(), User.getFallback())%></td>
<td><%=Lang.get("SelectDataOption", User.getPrimary(), User.getFallback())%></td>
<rdb-DataOption recfav="<%=strDisabled %>" dataseriescheck="<%=strDataOption[0] %>" ><%=Lang.get("ShowDataSeries", User.getPrimary(), User.getFallback())%></rdb-DataOption>
<rdb-DataOption recfav="<%=strDisabled %>" cumulativecheck="<%=strDataOption[1] %>" ><%=Lang.get("ShowCumulative", User.getPrimary(), User.getFallback())%></rdb-DataOption>
<rdb-DataOption recfav="<%=strDisabled %>" aggregatecheck="<%=strDataOption[2] %>" ><%=Lang.get("ShowAggregate", User.getPrimary(), User.getFallback())%></rdb-DataOption>
<rdb-DataOption recfav="<%=strDisabled %>" averagecheck="<%=strDataOption[3] %>" ><%=Lang.get("ShowDataSeriesAverage", User.getPrimary(), User.getFallback())%></rdb-DataOption>
</table-RdbDataOptions>
</CODE>
The following is the error I'm receiving:
javax.servlet.jsp.JspException: Error applying stylesheet..........
I can easily produce a table with like this:
____________________
|radio button description |
|radio button description |
|radio button description |
|radio button description |
|____________________|
but unfortunately that's not what's req'd!
Any help is disciplining the above stylesheet so that it does what its told would be greatly appreciated.
Yours, with respect!
Eddie.