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

Re: Counting Child Nodes

Subject: Re: Counting Child Nodes
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Nov 2002 16:08:11 -0700
xslt count child nodes
At 03:38 PM 11/26/2002, you wrote:
The algorithm I would use to determine how many rows and columns would be as follows:
T = Total number of children
R = Number of children displayed per row
C = Number of columns needed


   <!-- find T -->
   T = ??

To count something, you use count(). For example, <xsl:variable name="T" select="count(/data/data)" />

Instead of your proposed algorithm (which is well thought-out, but not right for XSLt), you're going to want to look up "grouping", "Muenchian", and "xsl:key" in the archives. Check out the link that will be appended to this letter after my sig for its location.

Also, you might want to refresh yourself on the available functions within xslt (like count, substring, substring-after, etc) since they will probably solve many of your future questions. I use www.topxml.com for a quick reference, though I have recently seen that it is not always pinpoint accurate about default values and the like. Others have listed their favorite reference sites in other postings on this list as well.


Greg Faron Integre Technical Publishing Co.



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • Counting Child Nodes
    • bix xslt - Tue, 26 Nov 2002 17:34:01 -0500 (EST)
      • Jorge A. Salido - Tue, 26 Nov 2002 17:58:52 -0500 (EST)
      • Ritu - Tue, 26 Nov 2002 18:01:35 -0500 (EST)
      • Greg Faron - Tue, 26 Nov 2002 18:03:38 -0500 (EST) <=
        • Paul - Tue, 26 Nov 2002 20:32:09 -0500 (EST)
          • Paul - Thu, 28 Nov 2002 11:08:44 -0500 (EST)

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.