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

paging problem -can't seem to figure it out

Subject: paging problem -can't seem to figure it out
From: "Rachel Doolan" <racheldoolan@xxxxxxxxxxx>
Date: Sun, 18 Mar 2001 23:20:00
paging problem
Hey guys

Thanks for the help so far!! I was hoping that somebody could help me out as I am really stuck with my paging problem. I have looked back at responses on the list and taken into account previous suggestions but I am still no clearer. I am using the code below to transform the xml document. Nothing is happening. Any suggestions would be really appreciated. Previous suggestions said that I had to use the true XSLT namespace. Have I included the right one??

Thanks in advance
Cheers Rach


---------------------XSL file <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"> <xsl:template match="/">

<HTML>

<BODY>

<TABLE>


<xsl:param name="recordsPerPage" select="10"/>


<xsl:param name="pageNumber"/>

<xsl:if test="position() &gt;= $recordsPerPage * number($pageNumber) and
position() &lt;= number($recordsPerPage * number($pageNumber) +
$recordsPerPage)">

  <xsl:element name="tr">
  <xsl:if test="position() mod 2 = 0">
	<xsl:attribute name="bgcolor">#ffffcc</xsl:attribute>
  </xsl:if>

     <xsl:element name="td">
	<xsl:value-of select="position()"/>
     </xsl:element>

     <xsl:element name="td">
           <xsl:value-of select="ALL/CATEGORY/title"/>
     </xsl:element>
     <xsl:element name="td">
        <xsl:value-of select="ALL/CATEGORY/desc"/>
     </xsl:element>
     <xsl:element name="td">
        <xsl:value-of select="ALL/CATEGORY/href"/>
     </xsl:element>
  </xsl:element>
</xsl:if>


<xsl:if test="$pageNumber &gt; 0"> <xsl:element name="a"> <xsl:attribute name="href">?page=myxmlpage&amp;sort=<xsl:value-of select='$sortField'/>&amp;pagenumber=<xsl:value-of select="number($pageNumber)-1"/></xsl:attribute> &lt;&lt; Previous Page </xsl:element> &#160; &#160; &#160; &#160; </xsl:if>


<xsl:if test="($timekeeperCount - ((1+number($pageNumber)) * $recordsPerPage)) > 0"> <xsl:element name="a"> <xsl:attribute name="href">?page=myxmlpage&amp;sort=<xsl:value-of select='$sortField'/>&amp;pagenumber=<xsl:value-of select="number($pageNumber)+1"/></xsl:attribute> Next page &gt;&gt; </xsl:element> </xsl:if> </center>

</TABLE>

</BODY>
</HTML>

 </xsl:template>
</xsl:stylesheet>Hey guys

Thanks for the help so far!! I was hoping that somebody could help me out as I am really stuck with my paging problem. I have looked back at previous stuff on the list and taken into account previous suggestions but I am still no clearer. I am using the code below to transform the xml document. Nothing is happening. Any suggestions would be really appreciated. Previous suggestions said that I had to use the true XSLT namespace. Have I included the right one??

Thanks in advance
Cheers Rach


---------------------XSL file <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"> <xsl:template match="/">

<HTML>

<BODY>

<TABLE>


<xsl:param name="recordsPerPage" select="10"/>


<xsl:param name="pageNumber"/>

<xsl:if test="position() &gt;= $recordsPerPage * number($pageNumber) and
position() &lt;= number($recordsPerPage * number($pageNumber) +
$recordsPerPage)">

  <xsl:element name="tr">
  <xsl:if test="position() mod 2 = 0">
	<xsl:attribute name="bgcolor">#ffffcc</xsl:attribute>
  </xsl:if>

     <xsl:element name="td">
	<xsl:value-of select="position()"/>
     </xsl:element>

     <xsl:element name="td">
           <xsl:value-of select="ALL/CATEGORY/title"/>
     </xsl:element>
     <xsl:element name="td">
        <xsl:value-of select="ALL/CATEGORY/desc"/>
     </xsl:element>
     <xsl:element name="td">
        <xsl:value-of select="ALL/CATEGORY/href"/>
     </xsl:element>
  </xsl:element>
</xsl:if>


<xsl:if test="$pageNumber &gt; 0"> <xsl:element name="a"> <xsl:attribute name="href">?page=myxmlpage&amp;sort=<xsl:value-of select='$sortField'/>&amp;pagenumber=<xsl:value-of select="number($pageNumber)-1"/></xsl:attribute> &lt;&lt; Previous Page </xsl:element> &#160; &#160; &#160; &#160; </xsl:if>


<xsl:if test="($timekeeperCount - ((1+number($pageNumber)) * $recordsPerPage)) > 0"> <xsl:element name="a"> <xsl:attribute name="href">?page=myxmlpage&amp;sort=<xsl:value-of select='$sortField'/>&amp;pagenumber=<xsl:value-of select="number($pageNumber)+1"/></xsl:attribute> Next page &gt;&gt; </xsl:element> </xsl:if> </center>

</TABLE>

</BODY>
</HTML>

 </xsl:template>
</xsl:stylesheet>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


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.