[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Paging using XSLT

Subject: RE: Paging using XSLT
From: "West, Wilson Y." <WWest01@xxxxxxxxxx>
Date: Mon, 30 Oct 2000 17:20:03 -0400 (EST)
xslt paging
I've done basically what you are asking. In bit's and pieces here's what
I've got: (you should probably focus on the IF statement)

<!--Set the paging characteristics - # of lines per page and page number-->
<!-- Set the number of records per page-->
<xsl:param name="recordsPerPage" select="50"/>

<!-- Page Number field -->
<xsl:param name="pageNumber"/>

<!--this performs the output in table format - the "if" does all of the
limiting work to show only 50 "records"-->
 <xsl:if test="position() &gt;= $recordsPerPage * number($pageNumber) and
position() &lt;= number($recordsPerPage * number($pageNumber) +
   <!-- Each timekeeper is on a seperate row -->
   <xsl:element name="tr">
   <xsl:if test="position() mod 2 = 0">
	<xsl:attribute name="bgcolor">#ffffcc</xsl:attribute>
      <!-- below shows the number of the item - for debug
      <xsl:element name="td">
	<xsl:value-of select="position()"/>
      <xsl:element name="td">
         <!--  The name -->
            <xsl:value-of select="@name"/>
      <xsl:element name="td">
         <xsl:value-of select="@title"/>
      <xsl:element name="td">
         <xsl:attribute name="align">center</xsl:attribute>
         <xsl:value-of select="@breffdate"/>
      <xsl:element name="td">
         <xsl:attribute name="align">center</xsl:attribute>
         <xsl:value-of select="@brrt01"/>
      <xsl:element name="td">
         <xsl:attribute name="align">center</xsl:attribute>
         <xsl:value-of select="@brcur"/>
   </xsl:element>   <!-- TK's tr -->

<!-- some logic to show previous/next page links-->
<!--Previous page, only show if pageNumber>0-->
<xsl:if test="$pageNumber &gt; 0">
	<xsl:element name="a">
		&lt;&lt; Previous Page 
	&#160; &#160; &#160; &#160; 

<!-- Next page, do not show when at end() of listing -->
<xsl:if test="($timekeeperCount - ((1+number($pageNumber)) *
$recordsPerPage)) > 0">
	<xsl:element name="a">
		Next page &gt;&gt;
<!--end of page links-->
<!-- end of link logic-->

Hope this helps somewhat.
I'm sure there are better ways of doing this, but I am new at this, and I
inherited the XML schema, so it'll work for us for now. Would love to see a
more efficient way, though.

Wilson West
Sidley & Austin

> -----Original Message-----
> From:	Bharat.Chintapally@xxxxxxxxxxxxxxxxx
> [SMTP:Bharat.Chintapally@xxxxxxxxxxxxxxxxx]
> Sent:	Monday, October 30, 2000 9:13 AM
> To:	XSL-List@xxxxxxxxxxxxxxxx
> Subject:	Paging using XSLT
> Good Morning folks:
>           I am trying to use XSLT to present large amounts of XML data in
> HTML tables. I need to implement a paging mechanism to let users navigate
> to previous and next pages etc. Has anybody implemented such a paging
> mechanism. Any pointers will be greatly appreciated.
> I am using MSXML in IE 5.5.
> Thanks for the help
> -- bharat
> ---------------------------------------------------------------
> Bharat Chintapally
> CommerceQuest Inc.
> bharat.chintapally@xxxxxxxxxxxxxxxxx
> New Phone # 813-639-6478
> ---------------------------------------------------------------
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


This e-mail is sent by a law firm and may contain information that is privileged or confidential.  If you are not the intended recipient, please delete the e-mail and any attachments and notify us immediately.

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.