[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: Counting Child Nodes
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Nov 2002 16:08:11 -0700
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)
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member