group by position
Description
This utility applies a template loop for multiple items instead of just one item
View example
XSLT
View Raw
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates select="entry[position() mod 4 = 1]" mode="group" /> </xsl:template> <xsl:template match="entry" mode="group"> <div class="groupitems"> <xsl:apply-templates select=". | following-sibling::entry[position() < 4]" mode="content" /> </div> </xsl:template> <xsl:template match="entry" mode="content"> <!-- Content goes here: for example: <h1><xsl:value-of select="title"/></h1> --> </xsl:template> </xsl:stylesheet>