Description
A VerifyError with a message similar to "Localvariable 5 contains the wrong type" might result if a stylesheet compiled by XSLTC contains a very large template, where the template contains a local variable that is referenced within a predicate or in one of expressions of an xsl:sort or xsl:number instruction. Here's the fragment that triggers the problem in a sample test case that I will attach:
<xsl:variable name="v" select="count(/doc/*)"/>
<xsl:if test="/doc/mid/mid/ch[$v+400 > .]">
<yes/>
</xsl:if>