Here's my XSLT:
<!-- Looping through both Items and Categories of Items -->
<xsl:for-each select="statement">
<!-- Define whether current node is a single item or a category of items -->
<xsl:choose>
<!-- Category of items -->
<xsl:when test="statement">
<!-- Render all items in this category -->
<xsl:for-each select="statement">
<xsl:call-template name="renderItem" select="current()" />
</xsl:for-each>
</xsl:when>
<!-- Single item -->
<xsl:otherwise>
<xsl:call-template name="renderItem" select="." />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
I want to be able to output specific number of items, but not all of them. How do I make "renderItem" to be executed not more than, say, 4 times?