[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: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 28 Jun 2000 19:18:05 +0100
xsl count number of nodes
Alex,

>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.lengt
h</xsl:eval></xsl:attribute>

If that (IMO monstrosity) works, then you might also have luck with:

  <xsl:attribute name="COLSPAN">
    <xsl:value-of select="count(*)" />
  </xsl:attribute>

If the attribute value template (i.e. the {count(*)}) didn't work, then at
a guess you're probably using a really old version of MSXML, and you would
be better off if you updated to the new, more compliant version, or
switching to a different XSLT processor.

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

Some of it is specific to Microsoft and some of it is stuff from an XSLT
Working Draft.  The xsl:eval element, which you use, for example, isn't
part of XSLT 1.0, and if you intend to use it, you should put it in a
different namespace to indicate the fact.

Cheers,

Jeni

Dr Jeni Tennison
Epistemics Ltd * Strelley Hall * Nottingham * NG8 6PE
tel: 0115 906 1301 * fax: 0115 906 1304 * email: jeni.tennison@xxxxxxxxxxxxxxxx


 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.