Page 1 of 1

[xslt1.0] Count the number of character

Posted: Thu Dec 19, 2013 5:27 pm
by Le Basque
Hi,
I would like to count the number of # in a string
example :

Code: Select all


<xx>1#2#3#4#</xx>
number of # = 4

exists a function to count character in string ?

Thank you

Re: [xslt1.0] Count the number of character

Posted: Thu Dec 19, 2013 6:25 pm
by Le Basque
i found a solution

Code: Select all


<xsl:variable name="nb_char" select="string-length(xx)-string-length(translate(xx,'#',''))"/>