Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Simple XSLT questions. >Thread Next - Re: Simple XSLT questions. Re: Simple XSLT questions.To: NULL Date: 5/9/2007 11:20:00 PM In article <1178739796.451024.200800@y...>, anitawa <anitawa@g...> wrote: >I want to know how you can count the number of certain character >inside one element. > >For example, counting commas. > ><place>CA,USA</place> should return 1 > ><place>Los Angeles,CA,USA</place> should return 2 > ><place>90210,Los Angeles,CA,USA</place> should return 3 Ok, here's a disgusting hack: string-length(.)-string-length(translate(., ',', '')) -- Richard -- "Consideration shall be given to the need for as many as 32 characters in some alphabets" - X3.4, 1963. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
