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

Subject: RE: count() problem
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sat, 17 Apr 2004 20:09:43 +0200
> -----Original Message-----
> From: Sam Saha [mailto:sam_saha1975@xxxxxxxx]

Hi,


<snip />
>   How do I use the count() function to count the
> number of nodes that do NOT have a blank value. I have
> the following xml. In this case the count should be 6.
<snip />
>
> I am doing something like this:
> <xsl:variable name="num"
> select="count(root/nodes/*[starts-with(local-name(),'tele')!=''
> or starts-with(local-name(),'node')!=''])" />
>

Hmm, this makes little sense, as you are counting nodes for which the
following expression:

starts-with(local-name(),'tele')

is not equal to ''

This will indeed be true also for the blank nodes, so you probably need
something like:

count(root/nodes/*[(starts-with(local-name(),'tele') or
                    starts-with(local-name(),'node'))
                    and not(.='')])


Hope this helps!

Cheers,

Andreas

Current Thread
  • count() problem
    • Sam Saha - Sat, 17 Apr 2004 13:40:39 -0400 (EDT)
      • Andreas L. Delmelle - Sat, 17 Apr 2004 14:02:15 -0400 (EDT) <=
      • Mukul Gandhi - Sun, 18 Apr 2004 01:21:50 -0400 (EDT)
      • <Possible follow-ups>
      • David . Pawson - Mon, 19 Apr 2004 03:39:58 -0400 (EDT)
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member