Subject: Re: [xsl] Complicated count() query From: Cassandra Bonner <cbonner_98@xxxxxxxxx> Date: Thu, 24 May 2001 22:25:21 -0700 (PDT) |
See if this helps you... http://www.dpawson.co.uk/xsl/N2018.html#d44e13410 Also, if you're parsing your document multiple times, you could add an element or attribute for each match, then count on the second parsing of the elements. Not really the best solution, but an option for you. This example is simplified and specific to 'John', but you could make this generic. It only works, of course if you're using a framework that allows for subsequent processing of your xml doc. [Not tested] <xsl:for-each select = "student"> <xsl:if test="starts-with(name,'John')"> <xsl:element name="johnCounter"/> </xsl:if> </xsl:for-each> The stylesheet for the second stylesheet would then count these nodes... count <xsl:value-of select="count(//johnCounter)"/> (use actual path) thx, cass --- Zak McGregor <zak@xxxxxxxxxxxx> wrote: > Hi all > > I have some data like this: > > <list> > <student> > <name>John Smith</name> > ... > </student> > <student> > <name>G. Whizz</name> > </student> > ... > </list> > > and I would like to do a case-insensitive count of all "john" > occurrences. Does anyone have any idea how to do this? I'm > completely > stumped. > > Thanks > > Zak > > -- > ==================================================================== > Zak McGregor > http://www.carfolio.com - Specifications of cars online. Over 7000! > -------------------------------------------------------------------- > Of course my password is the same as my pet's name. > My macaw's name was Q47pY!3, but I change it every 90 days. > ==================================================================== > > XSL-List info and archive: > http://www.mulberrytech.com/xsl/xsl-list > __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Complicated count() query, Jarno Elovirta | Thread | RE: [xsl] Complicated count() query, Michael Kay |
RE: [xsl] Complicated count() query, Jarno Elovirta | Date | [xsl] problem with xsl:choose, Student1 ASCO-ELK (R |
Month |