B
bearclaws
I am looping through a list of categories and want to display the list
horizontally (instead of vertically). I want to create a single row
with 4 list items in each cell of the row.
I thought this would work but I get this error:
"End tag 'xsl:if' does not match the start tag 'ul'."
Any thoughts?
<table border="1">
<tr>
<xsl:for-each select="category">
<!-- START CELL & LIST -->
<xsl:if test="position() = 1">
<td><ul>
</xsl:if>
<!-- LIST CATEGORY NAME -->
<li><xsl:value-of select="@name"/></li>
<!-- IF 4 LISTED: CLOSE LIST/CELL AND START NEW CELL -->
<xsl:if test="position() mod 4 = 0 and position() != last()">
</ul></td><td><ul>
</xsl:if>
<!-- CLOSE CELL IF LAST ITEM -->
<xsl:if test="position() = last()">
</ul></td>
</xsl:if>
</xsl:for-each>
</tr>
</table>
horizontally (instead of vertically). I want to create a single row
with 4 list items in each cell of the row.
I thought this would work but I get this error:
"End tag 'xsl:if' does not match the start tag 'ul'."
Any thoughts?
<table border="1">
<tr>
<xsl:for-each select="category">
<!-- START CELL & LIST -->
<xsl:if test="position() = 1">
<td><ul>
</xsl:if>
<!-- LIST CATEGORY NAME -->
<li><xsl:value-of select="@name"/></li>
<!-- IF 4 LISTED: CLOSE LIST/CELL AND START NEW CELL -->
<xsl:if test="position() mod 4 = 0 and position() != last()">
</ul></td><td><ul>
</xsl:if>
<!-- CLOSE CELL IF LAST ITEM -->
<xsl:if test="position() = last()">
</ul></td>
</xsl:if>
</xsl:for-each>
</tr>
</table>