I am using Saxon 9.1 to convert OpenOffice ODT documents to XHTML, using XSLT files that are included in the OpenOffice distribution.  I have run into problems with a particularly complicated document that contains several hundred styles.  Saxon is giving the error message Too many nested template or function calls. The stylesheet may be looping.  The problem is with a recursive template, which is failing after 505 calls.  I tried to fix the problem by increasing the amount of memory via the Java Xmx option.  But the transformation continues to fail at exactly the same point, regardless of how much memory I specify.

Does Saxon have a fixed limit for the number of recursions, or is my problem more subtle?


Steve Adcock


Geological Survey of Canada