This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How do I count number of nodes?
- To: xsl-list at mulberrytech dot com
- Subject: Re: How do I count number of nodes?
- From: Warren Hedley <w dot hedley at auckland dot ac dot nz>
- Date: Wed, 28 Jun 2000 10:38:45 -0400
- CC: alex chang <shortestpath at hotmail dot com>
- Organization: Department of Engineering Science, The University of Auckland
- References: <20000628125115.173.qmail@hotmail.com>
- Reply-To: xsl-list at mulberrytech dot com
alex chang wrote:
>
> How do I cound the total number of children (this will be my x) of the
> column-header element?
Check out the XPath function count(). I seem to remember you're using
IE5 MSXML1, so it may be called something else.
http://www.w3.org/TR/xpath#function-count
The following should do the trick.
<td valign="center" colspan="{count(*)}"> ... </td>
> Also, should I add the number of upper-left elements
> + the number of mh elements, or should I just take the total number of
> elements under column-header, regardless of who they are?
That depends what you want the output to look like. You
can count the two element types separately.
<td valign="center"
colspan="{count(upper-left) + count(mh)}"> ... </td>
--
Warren Hedley
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list