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

Re: How do I count number of nodes?

Subject: Re: How do I count number of nodes?
From: "alex chang" <shortestpath@xxxxxxxxxxx>
Date: Wed, 28 Jun 2000 12:31:26 EDT
xpath count number of nodes
It was actuallly putting the string {count(*)} as the value of colspan.
I did find something that works though:
<xsl:attribute name="COLSPAN"><xsl:eval>selectSingleNode("column-header").childNodes.length</xsl:eval></xsl:attribute>


This is using the XML DOM Reference from the microsoft site:
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/xmlsdk/xmls6g53.htm

A quick question about this XML DOM Reference- is the syntax in there specific to Microsoft and IE? Or can this be used with any parser? It doesn't say on they site...

-alex


From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxx
CC: alex chang <shortestpath@xxxxxxxxxxx>
Subject: Re: How do I count number of nodes?
Date: Wed, 28 Jun 2000 10:38:45 -0400

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

________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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



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.