I have a list of elements that I want to split into individual lists of 3. The end result would be something like this:
<ul>
<li>element</li>
<li>element</li>
</ul>
<ul>
<li>element</li>
<li>element</li>
</ul>
<ul>
<li>element</li>
<li>element</li>
</ul>
My XSLT is like this, but it doesn't work, because I can't insert </ul>
, and I can't insert a less than sign (<
).
<ul>
<xsl:for-each select="$myroot/item">
<li></li>
<xsl:if test="position() mod $maxItemsPerColumn = 0">
<!-- I want to close my ul, and start a new one here, but it doesn't work! -->
</xsl:if>
</xsl:for-each>
</ul>
Any ideas? Thanks in advance!