RE: [xsl] Logical in Count function

Subject: RE: [xsl] Logical in Count function
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 18 Aug 2004 12:47:00 -0400
> 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