[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Complicated count() query - thanks

Subject: Complicated count() query - thanks
From: Zak McGregor <zak@xxxxxxxxxxxx>
Date: Fri, 25 May 2001 15:06:07 +0200
count query
Thanks to all who responded to my question!

Jarno's solution was the one I'm going with, thanks Jarno.

Which I'll echo here, in case this helps anyone else too...

  <xsl:value-of select="count(/list/student[contains(translate(name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'john')])"
/>

woudl give a count of all the students whose name has "john" in it
somewhere.

My mistake had been to put the path inside the translate, which now
seems obviously stupid, ie:

  <xsl:value-of select="count([contains(translate(/list/student/name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), 'john')])"
/>

I think I had ommitted the square brackets as well :(

Thanks again all

Cheers

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.