update:
This question has some little xsl code in it !
I\'m struggling with this problem for weeks (even months). I\'m rather beginner throu
Given:
XML
<group>
<item> 01 </item>
<item> 02 </item>
<item> 03 </item>
<item> 04 </item>
<item> 05 </item>
<item> 06 </item>
<item> 07 </item>
<item> 08 </item>
<item> 09 </item>
<item> 10 </item>
<item> 11 </item>
<item> 12 </item>
<item> 13 </item>
<item> 14 </item>
<item> 15 </item>
<item> 16 </item>
<item> 17 </item>
<item> 18 </item>
<item> 19 </item>
<item> 20 </item>
<item> 21 </item>
<item> 22 </item>
<item> 23 </item>
<item> 24 </item>
<item> 25 </item>
<item> 26 </item>
</group>
the following stylesheet:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="pageSize" select="5" />
<xsl:param name="pageNumber" select="3" />
<xsl:template match="/group">
<html>
<body>
<div id="page{$pageNumber}">
<ul>
<xsl:variable name="start" select="$pageSize * ($pageNumber - 1) + 1" />
<xsl:for-each select="item[position() >= $start and position() < $start + $pageSize]">
<li>
<xsl:value-of select="."/>
</li>
</xsl:for-each>
</ul>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
will return:
Result
<html>
<body>
<div id="page3">
<ul>
<li> 11 </li>
<li> 12 </li>
<li> 13 </li>
<li> 14 </li>
<li> 15 </li>
</ul>
</div>
</body>
</html>