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

Counting sub-nodes per page in xsl with custom paging

Subject: Counting sub-nodes per page in xsl with custom paging
From: Anthony DiSalvo <ajdisalvo@xxxxxxxxx>
Date: Fri, 10 Dec 2004 12:09:52 -0800 (PST)
anthony disalvo
Hey everyone,

This is the first time that I am posting to the xsl list and I am
pretty new to xsl. 

I would appreciate any help that you can provide with an issue I am
having.

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

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.