how to count the number of the same character

Here should go questions about transforming XML with XSLT and FOP.
Nikky_zhang
Posts: 18
Joined: Thu Jan 21, 2016 10:28 am

how to count the number of the same character

Post by Nikky_zhang »

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: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: how to count the number of the same character

Post by Radu »

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/1458 ... ng-in-xslt

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