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

Re: Counting occurences of a character in a string

Subject: Re: Counting occurences of a character in a string
From: "Christian Roth" <roth@xxxxxxxxxxxxxx>
Date: Wed, 2 Apr 2008 00:56:15 +0200
Re:  Counting occurences of a character in a string
David Carlisle wrote:

>count(tokenize($s,'X'))-1

Ahh - and that is a use case for the zero-length elements (tokens)
generated when the separator pattern is matched directly at the start or
end of a string. I was wondering about that behaviour, and it was
actually my first pitfall in my initial attempt at a solution.

Thanks to all who responded so quickly! I'll make an xsl:function and
pick one of the implementations. Since that function will not be called
often, I guess I will not see a measurable (or better: relevant)
performance difference.

Christian

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.