This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Complicated count() query


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]