createIterationBlocks (itemCount : int, blockSize : int) : nodeset

A number of itemCount elements can be divided into units with the method “createIterationBlocks”. These units each contain blockSize items.

<xsl:stylesheet version="1.0">
<xsl:template match="/">
<xsl:variable name="items""Node">
<item>Nummer 1</item>
<item>Nummer 2</item>
<item>Nummer 3</item>
<item>Nummer 4</item>
<item>Nummer 5</item>
<item>Nummer 6</item>
<item>Nummer 7</item>
<xsl:for-each select="util:createIterationBlocks(count($items/item), 3)">
<xsl:for-each select="item">
<xsl:variable name="index" select="number(@index)" />
<xsl:value-of select="@index" />
<xsl:value-of select="$items/item[$index]" />
Output of elements in a table


1: Number 1 2: Number 2 3: Number 3
4: Number 4 5: Number 5 6: Number 6
7: Number 7

In the example, seven elements are written into a table where it is stipulated for each column to contain a unit of three elements.