how to count the number of the same character

Here should go questions about transforming XML with XSLT and FOP.
Nikky_zhang
Posts: 17

how to count the number of the same character

Fri Jul 01, 2016 11:39 am

Hi ,

I am facing a problem without any solution. Can anyone help?

The problem is , I am trying to count the number of the same character appeared in a string.

For example,

<xsl:if test="contains(x1,x2)">

I want to express, if there are more than two X2 appeared in x2, then execute something. I don't know how.

anyone knows?
Radu
Posts: 5221

Re: how to count the number of the same character

Fri Jul 01, 2016 11:47 am

Hi,

As the question is not directly related to Oxygen maybe you could consider using a specialized XSLT mailing list or writing on Stack Overflow.

Maybe this StackOverflow older post will help:

http://stackoverflow.com/questions/1458001/find-the-number-of-occurences-of-a-substring-in-a-string-in-xslt

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 1 guest