RE: [xsl] Complicated count() query

Subject: RE: [xsl] Complicated count() query
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 25 May 2001 13:06:26 +0100
> and I would like to do a case-insensitive count of all "john"
> occurrences.

To count the <name> elements containing "john" (not the number of
occurrences of "john"), do:

count(//name[contains(translate(., $upper, $lower), 'john')])

where
<xsl:variable name="upper">ABCDE...XYZ...</xsl:variable>
<xsl:variable name="lower">abcde...xyz...</xsl:variable>

with enough characters to handle the alphabet you are using.

Mike Kay
Software AG



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread