Re[2]: xsl:variable {RE: XSL to handle display mutiple pages}

Subject: Re[2]: xsl:variable {RE: XSL to handle display mutiple pages}
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 8 Nov 2000 10:49:18 +0000

> This is related to the pagination problem I had earlier.  Since my first
> page has header, it can only contain 50 lines, while the latter page can
> contain 60 lines.  So I want to set $maxItemsPage to be 50 for the first
> page, and 60 for the following pages.
> What is the easier way to achieve this?

Have two parameters:

<xsl:param name="maxItemsFirstPage" select="50" />
<xsl:param name="maxItemsOtherPages" select="60" />

and choose which of those values to use according to which page you're
generating. I forget whether you're generating the pages all at once
or different ones with each process, but if the latter you could use a
global variable, for example:

<xsl:param name="current-page" select="3" />

<xsl:variable name="maxItemsPage">
    <xsl:when test="$current-page = 1">
      <xsl:value-of select="$maxItemsFirstPage" />
      <xsl:value-of select="$maxItemsOtherPages" />

I hope that helps,


Jeni Tennison

 XSL-List info and archive:

Current Thread