This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Pagination


> Thanks for your solution. But the problem is a bit more 
> complex. I have on my page a drop down Select, which 
> indicates the page number. I have written a javascript 
> function that is called onChange= of the select object.
> 
> When the user selects a page number, lets say page number 4 
> the page should display records from 31-40. If the user 
> presses page number 5 it should display records from 41-50 etc.

You need to do a new transformation for each user request, that takes the
starting page number as a parameter. You access this parameter in the
stylesheet using a global variable such as <xsl:param name="startpage"
select="1"/>. Then your root template does something like

<xsl:apply-templates select="//record[number($startpage)]"/>

To see how to supply the parameter, see the Microsoft API documentation, or
the example on page 608 of Wrox XSLT Programmer's Reference.

Mike Kay


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]