Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Counting occurences of a character in a string

From: "Christian Roth" <roth@-------------->
To:
Date: 4/1/2008 10:57:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent