RE: [xsl] paging problem -can't seem to figure it out

Subject: RE: [xsl] paging problem -can't seem to figure it out
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Sun, 18 Mar 2001 23:36:11 -0000
> <xsl:template match="/">
> <HTML>
> <BODY>
> <TABLE>

> <xsl:param name="recordsPerPage" select="10"/>
>
> <xsl:param name="pageNumber"/>

There's something wrong here: the root template is called automatically by
the system, so it never has any parameters. These should almost certainly be
global parameters, outside the <xsl:template>.
>
> <xsl:if test="position() &gt;= $recordsPerPage *
> number($pageNumber) and
> position() &lt;= number($recordsPerPage * number($pageNumber) +
> $recordsPerPage)">

There's something wrong here, too. The position() function returns the
position of the context node in the list of nodes being processed, so in the
case of the root template it will always return 1. I haven't tried to
understand your logic to work out what you're expecting it to be, but
there's clearly an error here.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread