update:
This question has some little xsl code in it !
I'm struggling with this problem for weeks (even months). I'm rather beginner through this xml/xslt area and I only need at least one working pagination technique for my xml data. I just can't seem to find just ONE working solution about this issue!!
I already state that, in my view, pagination is one of the most useful xml/xslt web topics and is one of the less discussed topics over the whole web. Only portions of it and most of them non-functional. Anyway, it's all about this stkovrflw question:
xslt xml table records pagination
where one could see my whole problem. It has been answered by michael.hor257k which I thank him very much. Point is it's only halfway working (as far as my requirement concerned)
I only need to display 5 nodes at a time, based on some parameter passed in which is the page number. I'll name it as
param name = "pagnmbr"
And, at first if this $pagnmbr is 1, that xslt will display:
01 02 03 04 05
Else, if it's 2 ($pagnmbr = 2), it will display:
06 07 08 09 10
And if same parameter become 3, the reading will be:
11 12 13 14 15
And so on. See, this kind of functionality I'm in very need for doing.
update: I just did the following xslt code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="crrtPag" select="2"/> <!-- current page -->
<xsl:variable name="rcrdsppag" select="5"/> <want 5 displaying records per page -->
<xsl:template name="pag" match="/group/item">
<html>
<body>
<xsl:if test="position()-$crrtPag = ($rcrdsppag - 1)*($crrtPag - 1)">
<xsl:call-template name="display_pag">
<xsl:with-param name="crrtPag" select="item[position() mod $rcrdsppag = 1]"/>
</xsl:call-template>
</xsl:if>
</body>
</html>
</xsl:template>
<xsl:template name="display_pag" match="item"> <!-- item -->
<xsl:param name="crrtPag"/>
<xsl:for-each select="//item">
<xsl:if test="position()<=5">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
But, as one could notice, it's kept showing only:
01 02 03 04 05
even if I put $pagnmbr = 2, or $pagnmbr = 3 .. pop up only the first 5 group items. It never shows up next node-set of
06 07 08 09 10
and so on ..
Please you guys help me with it !!! Thank you very much in advance.