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

Re: [newbie]use of xsl:if {RE: XSL to handle display mutiple

Subject: Re: [newbie]use of xsl:if {RE: XSL to handle display mutiple pages}
From: Mike Brown <mike@xxxxxxxx>
Date: Fri, 3 Nov 2000 15:06:23 -0700 (MST)
Re: [newbie]use of xsl:if {RE: XSL to handle display mutiple
My solution was the same as Jeni's. We had different ways of selecting
which item starts each page, and getting the next ($maxItemsPage -1)
items, but the overall method and outcome is the same. I also had a couple
of minor errors in my untested code sample. The corrected version is
below.

 <!-- start a new table for item 1, 51, 101, 151, etc. -->
 <xsl:for-each select="$items[(position()+1) mod $maxItemsPage + 1 = 1]">
   <xsl:variable name="currentPos" select="(position() - 1) * $maxItemsPage + 1"/>
   <table width="100%" border="1" cellspacing="0">
     <tbody>
       <!-- start a new row for current item and the next 49 -->
       <xsl:for-each select="$items[position() &gt;= $currentPos and position() &lt; $currentPos + $maxItemsPage]">
         <tr>
           <td>
             <xsl:value-of select="."/> <!-- or whatever -->
           </td>
         </tr>
       </xsl:for-each>
     </tbody>
   </table>
   <!-- output separator if we're not on the last item in the set -->
   <xsl:if test="$currentPos + $maxItemsPage &gt; count($books)">
     <div style='page-break-before: always'/>
   </xsl:if>
 </xsl:for-each>

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 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.