Page 1 of 1

XSLT stack overflow crashes oXygen 4.0

Posted: Sun May 02, 2004 5:54 am
by dsewell
The following applies to the new oXygen 4.0 release for Mac OS X.

I stupidly created an XSLT script with the following code:

Code: Select all

<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="."></xsl:apply-templates>
</xsl:copy>
</xsl:template>
This creates an infinite loop, and therefore a stack overflow in the Java parser. If this code is run in the XSLT debugger, it produces an error message "class java.lang.StackOverflowError". But if it is run from the XML editor as a Transformation, oXygen crashes (both for the Saxon and the Xalan transformer).

Obviously, one solution is not to run stupid code. :?
But if oXygen could trap this error and respond gracefully that would be ideal.

Posted: Mon May 03, 2004 5:08 pm
by george
Hi David,

We tried this stylesheet on Mac 10.3 with the latest updates and also on Windows. In both configurations it gives a stack overflow error but the application does not crash. For the debugger you can set an option that controls the maximum number of nested templates during a transformation. Oxygen will show an warning giving you the opportunity to stop that transformation. The option is located in the Options->Preferences -- XSLT/FO->Debugger dialog, see:
http://www.oxygenxml.com/doc/ug-oxygen/ ... ugger.html

Best Regards,
George