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

RE: count() problem

Subject: RE: count() problem
From: "Andreas L. Delmelle" <a_l.delmelle@xxxxxxxxxx>
Date: Sat, 17 Apr 2004 20:09:43 +0200
sam saha
> -----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)

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.