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

RE: Logical in Count function

Subject: RE: Logical in Count function
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 18 Aug 2004 12:47:00 -0400
xsl count function
> From: Tham Tinh [mailto:khautinh@xxxxxxxxx]
>
> I still have anohter question how to use logical and,
> or in Count function.  I wrote
> <p>Employee Count: <xsl:value-of
> select="count(/dsWMSRpt/WMSReport[Person_x0020_Name!='Vacancy']
> and /dsWMSRpt/WMSReport[Person_x0020_Name!=''])"/></p>
>
> and I got an error.  Am I wrong to use logical and in
> it?  Please correct for me.

You just have your "and" operator in the wrong place.  You cannot use
"and" or "or" in a path expression, but that would not be what you want
here anyway.  Instead, you probably want

count(/dsWMSRpt/WMSReport[Person_x0020_Name!='Vacancy' and
Person_x0020_Name!='']

You might want to use normalize-space(Person_x0020_Name)

(without the !='', which wouldn't be necessary), in case a name element
happens to contain only whitespace.

Cheers,

Tom P

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.