If the problem goes away when you delete (or comment out) some, then either there is a limit or the ones you deleted are coded wrong.
Since all of the starts-with functions are in a single
string, there may be a limit on the length of the string.
But, I think you are in luck. If your xsl:when
test is just a series of starts-with's separated by or's, you can make more than one xsl:when groups. If the EVENT doesn't match one of the strings in the first xsl:when, it will look for the next xsl:when. Pick a reasonable size and put 5-10 of them in each xsl:when block.
I don't know the overhead of processing a compound test (x or y or z) vs. separate xsl:when statements. It might be faster to put each test in a separate xsl:when.