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

Sort and paging problem

Subject: Sort and paging problem
From: "Fran" <franciscojose@xxxxxxxxxxx>
Date: Fri, 14 Mar 2003 09:27:49 +0100
paging problem
Hey guys!!
 I post this problem because I'm a XSL beginner and I have looked back at
responses
on the list and taken into account previous suggestions and codes but my
code still don't
work how I want.  I am using the code below to transform the xml document.
First I'm trying to order all HOTEL elements
within attribute "price" and then I want to paginate this, but my code don't
make this exactlly. It pagings ok, but It sorts only the records that are at
page(not all the records), because I want firts order all records and then
paginate to 10 records each page.
Any suggestions would be really appreciated.

Thanks in advance
Frank Vargas

Code:

.....
<xsl:param name="RecordsPerPage" select="5" />
<xsl:param name="PageNumber" />
<xsl:variable name="start" select="((number($PageNumber) - 1) *
(number($RecordsPerPage))) + 1"/>
<xsl:variable name="end" select="($start - 1) + (number($RecordsPerPage))"/>
<xsl:variable name="count" select="(count(DISPONIBILIDAD/LHOTEL/HOTEL))"/>

<xsl:template match="/">

<xsl:for-each select="DISPONIBILITY/LHOTEL/HOTEL[position() >= $start and
position() &lt;= $end]">
	<xsl:sort select="number(@price)"/>
</xsl:for-each>

.....
 <b>Order
  <xsl:choose>
	<xsl:when test="$end >= $count and $start = 1">
		<xsl:value-of select="$start"/>-<xsl:value-of select="$count"/>
		de <xsl:value-of select="$count"/>&#160;
	</xsl:when>
      <xsl:when test="$end >= $count">
      <xsl:when .....(Code to put the records order and to put the previous
and Next button
  </xsl:choose>
  </b>
....



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.