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

Re: how to count the number of the same character

Post by Radu » 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/1458 ... ng-in-xslt

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

Post Reply