I'm not sure these Stylus Studio settings have any effect when using Saxon as the XSLT processor.
It's possible though (I'm not sure) that tail recursion optimization is switched off when in a tracing/debugging environment, so if you are running in an IDE, it's probably worth checking it from the command line.
It would be also a good idea to post the relevant code fragments here (that is, the recursive template) so we can see whether tail recursion ought to be kicking in. The -explain output will also help here.
Michael Kay

From: Waters, Michael, Springer US [mailto:Mike.Waters@springer.com]
Sent: 23 February 2009 16:40
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Setting Maximum recursion depth

I don’t have Stylus Studio installed anymore, but I had the same problem a while ago, i.e., a table with a few columns, but thousands of rows. >From what I remember, there were some settings in Stylus Studio you can try.


From their Developer forum:


“Im doing an XSL conversion of data exported from a CSV file. The XML file is approximately 11MB with over 11,000 rows of data. I keep getting the error that "XSLT processor has exceeded the maximum recursion depth".

I have tried maxing ouot the Maximum recursion level to high as well as disabling infinite loop detection. Are there any workarounds for large file conversion support?”


A solution that worked for a user:


“It looks like you are hitting a bug; the value of "Enable infinite loop detection" option doesn't seem to be honored.

For the time being, you can workaround the problem setting a very high value for the maximum recursion level directly in the registry, like, for example:

[HKEY_CURRENT_USER\Software\Stylus Studio\2008 XML Enterprise Suite Release 2\Plugin Settings]
"XSLT Editor: Option: RecursionLevel"=dword:00010000

(the correct registry key will depend on which Stylus Studio version/edition you are running)
Changes to the Tools > Options page will tend to reset that value to the maximum value accepted by the UI (500 decimal).”


So, if you stay in Stylus Studio, the above might work.



Mike Waters





From: Cuzner Stephen P [mailto:Stephen.P.Cuzner@irs.gov]
Sent: Monday, February 23, 2009 10:30 AM
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: [saxon] Setting Maximum recursion depth


I'm running saxon in Stylus Studio using a custom stylesheet that uses the cals/oasis table module from the docbook stylesheet collection. My instance xml document has a huge table, not too many columns, but thousands of rows. When it gets to about 500 rows the process dies saying the the maximum recursion depth has been exceeded. Is this memory dependent, related to the jvm, or a setting/preference in saxon that I can change?