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

Re: Displaying 10 Records at a time

Subject: Re: Displaying 10 Records at a time
From: andrew.curry@xxxxxxxxxxxx
Date: Sun, 2 Nov 2003 11:21:53 -0000
select 10 records
You could try something like this

 <xsl:template name="list_pages">
                <xsl:variable name="totalrecords" select="count(RECORDS)"/>
                <xsl:variable name="pages" select="ceiling($totalrecords div
10)"/>
                <xsl:call-template name="produce-pages">
                        <xsl:with-param name="count" select="1"/>
                        <xsl:with-param name="max" select="$pages+1"/>
                </xsl:call-template>
        </xsl:template>

<xsl:template name="produce-pages">
                <xsl:param name="count"/>
                <xsl:param name="max"/>
                <xsl:param name="maxpages" select="$count * 10"/>
                <xsl:param name="minpages" select="($maxrunners - 10) +1"/
>
                <xsl:param name="pagecount" select="0"/>
                <xsl:if test="$count != $max">
    <xsl:for-each select="RECORD">
            <xsl:if test="position() &lt;=$maxpages and position()
&gt;=$minpages">
<!-- 
do your working here
-->
             </xsl:if>
     </xsl:for-each>

                <xsl:call-template name="produce-pages">
                                <xsl:with-param name="count" select="$count+
1"/>
                                <xsl:with-param name="max" select="$max"/>
                        </xsl:call-template>
                </xsl:if>
        </xsl:template>

----- Original Message ----- 
From: "karthikeyan.balasubramanian"
<karthikeyan.balasubramanian@xxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, November 03, 2003 11:07 AM
Subject:  Displaying 10 Records at a time


> Hi,
>
>   I am not sure if I have put correct subject.
>
>   I want to display 10 records in a table
> after this I want to show horizontal line and
> display another 10 and this sequence
> continues.  How do I keep track of this
> information?
>
>
> Output
> =====
>
> heading : data1
> data1, data2, data3, data4, data5
> data6, data7, data8, data9, data10
>
> ============================
> heading: data11
> data11, data12, data13, data14, data15
> data16, data17, data18, data19, data20
> ============================
>
> heres my xsl
> ============
>
>  <xsl:template match="NI">
>   <h1>heading : ?</h1>
>   <table>
>    <tr>
>     <td>sub-title1</td>
>     <td>sub-title2</td>
>    </tr>
>    <xsl:for-each select="TABLE/TBODY/ROW">
>    <tr>
>     <td>
>      <xsl:value-of select="ENTRY[1]/PARA[1]"/>
>     </td>
>     <td>
>      <xsl:value-of select="ENTRY[2]/PARA[2]"/>
>     </td>
>    </tr>
>    </xsl:for-each>
>   </table>
>  </xsl:template>
>
> sample xml
> ===========
>
> <NI PUBLISH="DEC31">
>  <TABLE>
>   <TBODY>
>    <ROW>
>     <ENTRY>
>      <PARA>MS9557-09</PARA>
>      <PARA LEVEL="2">73 34 15  01  010</PARA>
>     </ENTRY>
>     <ENTRY>
>      <PARA/>
>      <PARA>3</PARA>
>     </ENTRY>
>    </ROW>
>    <ROW>
>     <ENTRY>
>      <PARA>MS9557-09</PARA>
>      <PARA LEVEL="2">73 34 15  01  010</PARA>
>     </ENTRY>
>     <ENTRY>
>      <PARA/>
>      <PARA>3</PARA>
>     </ENTRY>
>    </ROW>
>   </TBODY>
>  </TABLE>
> </NI>
>
> Have a great day.
>
> Karthikeyan B
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.