I am writing a script to find the number of occurrences of a substring in a string in XSLT. It\'s taking too much time when I want to traverse it in more than 200k records.
http://www.xsltfunctions.com/xsl/functx_number-of-matches.html
as documented:
count(tokenize($arg,$pattern)) - 1
I would write it as:
count(tokenize($string,$substring)) - 1
in your case:
count(tokenize('My Name is Rohan and My Home name is also Rohan but one of my firend honey name is also Rohan','Rohan')) - 1
PS: you spelled 'friend' incorrectly.
I tested this method for my own use-case in XSLT version 2.0, It might also work in 1.0 not sure based on the documentation.