[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Sort and paging problem
Subject: [xsl] Sort and paging problem From: "Fran" <franciscojose@xxxxxxxxxxx> Date: Fri, 14 Mar 2003 09:27:49 +0100 |
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() <= $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"/>  </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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Comparison evaluation in , Gregory Murphy | Thread | RE: [xsl] Sort and paging problem, Jarno . Elovirta |
[xsl] Comparison evaluation in XPat, Gregory Murphy | Date | RE: [xsl] Sort and paging problem, Jarno . Elovirta |
Month |