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

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)
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

 <!-- 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">
       <!-- start a new row for current item and the next 49 -->
       <xsl:for-each select="$items[position() &gt;= $currentPos and position() &lt; $currentPos + $maxItemsPage]">
             <xsl:value-of select="."/> <!-- or whatever -->
   <!-- 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'/>

   - Mike
Mike J. Brown, software engineer at         My XML/XSL resources: in Denver, Colorado, USA 

 XSL-List info and archive:

Current Thread