xsl-list
[Top] [All Lists]

Custom paging and counting sub-nodes per page in xsl

2004-12-01 21:10:33
Here is the issue:
  
I am generating a potentially multi-page html document.
I have the issue of repeating the header and footer worked out.
I can only display a certain number, (15), of sample nodes per page,
so when the sample node position/ 15 is greater than 1, 2, etc. I
insert the header again. Example xml and xsl is below.
  
 <sample>
             <container></container> 
             <container></container> 
             <container></container> 
             <container></container> 
 </sample>
 <sample>
             <container></container> 
             <container></container> 
 </sample>
 <sample>
             <container></container> 
 </sample>
 <sample>
             <container></container> 
             <container></container> 
             <container></container> 
 </sample>
  
             <xsl:template name="pageNumber">
                         
                         <xsl:choose>
                                     <xsl:when test="position() mod
15 =0">
                                                
<xsl:value-ofselect="round(position() div 15 + 1)"/>
                                     </xsl:when>
                                     <xsl:otherwise>
                                                 <xsl:value-of
select="round(position() div 15 + 1)"/>
                                     </xsl:otherwise>            
                         </xsl:choose>
             </xsl:template>
  
  
 I have been able to generate a page number such as "page 1 of
2",also using this technique.
  
The problem I have not been able to figure out that I want to coun
and
display how many container nodes exist on a specific page, for
example "# of containers for this page = 25".
 
Any ideas on how I might do this?
 
Thanks,
  
Tony DiSalvo
 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>
  • Custom paging and counting sub-nodes per page in xsl, Anthony DiSalvo <=