This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Complicated count() query
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Complicated count() query
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 25 May 2001 13:06:26 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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