|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Paging and Sorting
I don't understand what you mean by:
Mark Nahabedian wrote: Somehow, the template which outputs the information about a single loan is being executed via another path than the one that wraps a table around them. This might be due to the built-in template which matches any element and does <apply-templates/>. I want to be able to display 10 loans per page, allow the user to page between the returned loans, and sort the loans in the table by clicking on the column titles. As I mentioned in my last email, when I click the column titles, sorting only occurs for the 10 loans listed on the page (and not all the loans returned). Also, the loans that are not being displayed in the table of 10 loans are displayed as text above the table. My XSL and XML are below: XSL: <?xml version='1.0'?> <!-- File sampleLoanSearchLC.xsl--> <xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'> <xsl:param name="column"> </xsl:param> <xsl:param name="lowerLimit" select="1"> </xsl:param> <xsl:param name="upperLimit" select="10"> </xsl:param>
<table> <tr> <td> <a href="/loans/SearchResults.jsp?{'sort=LoanId&upperLimit=10&action=None'}{'&counter='}{$counter}"><b>Loan Number</b></a> </td> <td> <a href="/loans/SearchResults.jsp?{'sort=LastName&upperLimit=10&action=None'}{'&counter='}{$counter}"><b>Name</b></a> </td> </tr> <xsl:apply-templates select="ReturnResultSet/LoanSearchSet/Loan"> <xsl:sort select="LoanId[$column = 'LoanId'] | LoanBorrowerSet[$column = 'LastName']/Borrower/LastName" /> </xsl:apply-templates> </table> <table> <tr> <td> <a href="/loans/SearchResults.jsp?sort={$column}&upperLimit={$upperLimit}&action=First&counter={$counter}"><b>First Page</b></a> </td> <td> <xsl:if test="$lowerLimit > 1"> <a href="/loans/SearchResults.jsp?sort={$column}&upperLimit={$upperLimit}&action=Previous&counter={$counter}"><b>Previous Page</b></a> </xsl:if> </td> <td> <xsl:if test="$counter > $upperLimit"> <a href="/loans/SearchResults.jsp?sort={$column}&upperLimit={$upperLimit}&action=Next&counter={$counter}"><b>Next Page</b></a> </xsl:if> </td> <td> <a href="/loans/SearchResults.jsp?sort={$column}&upperLimit={$upperLimit}&action=Last&counter={$counter}"><b>Last Page</b></a> </td> </tr> </table> </xsl:template> <xsl:template match="ReturnResultSet/LoanSearchSet"> <xsl:apply-templates select="Loan[position() >= $lowerLimit and position() <= $upperLimit]"/> </xsl:template> <xsl:template match="Loan[position() >= $lowerLimit and position() <= $upperLimit]">
<td> <xsl:for-each select="LoanBorrowerSet/Borrower"> <xsl:if test="Rank='1'"> <xsl:value-of select="LastName"/> </xsl:if> </xsl:for-each> </td> </tr> </xsl:template> </xsl:stylesheet> XML: <ReturnResultSet> <LoanSearchSet> <Loan> <LoanId>123</LoanId> <LoanBorrowerSet> <Borrower> <LastName>Smith</LastName> </Borrower> </LoanBorrowerSet> </Loan> <Loan> <LoanId>456</LoanId> <LoanBorrowerSet> <Borrower> <LastName>Jones</LastName> </Borrower> </LoanBorrowerSet> </Loan> <Loan> <LoanId>789</LoanId> <LoanBorrowerSet> <Borrower> <LastName>Stills</LastName> </Borrower> </LoanBorrowerSet> </Loan> ... </LoanSearchSet> </ReturnResultSet> -Katie From: Mark Nahabedian <naha@xxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: Paging and Sorting Date: Thu, 18 Oct 2001 17:25:29 -0400 _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








