XSLT stack overflow crashes oXygen 4.0

Having trouble installing Oxygen? Got a bug to report? Post it all here.
dsewell
Posts: 125
Joined: Mon Jun 09, 2003 6:02 pm
Location: Charlottesville, Virginia USA

XSLT stack overflow crashes oXygen 4.0

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
Post Reply