| Subject: Re: [xsl] How is memory allocated in recursive XSLT templates? From: "Rashmi Rubdi" <rashmi.sub@xxxxxxxxx> Date: Wed, 2 May 2007 19:31:36 -0400 | 
> -Xss###k did not > help anything, which makes me believe that the maximum > recursive depth is enforced by Saxon somehow. >
java -Xss8192k -jar c:\dev\saxonb8-9-0-3j\saxon8.jar -it mainTemplate recursion.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:f="http://factorial.com/">
<xsl:template name="mainTemplate"> <xsl:value-of select="f:fac(10446)"/> </xsl:template>
<xsl:function name="f:fac">
     <xsl:param name="nr"/>
     <xsl:sequence select="if($nr = 0) then 1 else f:fac($nr -1) * $nr" />
</xsl:function>and it gave the output similar to the Java Factorial program, however I couldn't and didn't want to measure the time because the time measurement is not precise anyway.
No, Saxon doesn't enforce any limit.
I'm not sure -Xss works in all environments. See for example
http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=4e8e9b5ea8255ffffffff c30b7a19a079137:WuuT?bug_id=6316197
Please note that -Xss8192k is not the ~minimum~ required memory to run the above factorial.
Michael Kay http://www.saxonica.com/
-Regards Rashmi
| Current Thread | 
|---|
| 
 
 | 
| <- Previous | Index | Next -> | 
|---|---|---|
| RE: [xsl] How is memory allocated i, Michael Kay | Thread | Re: [xsl] How is memory allocated i, Rashmi Rubdi | 
| Re: [xsl] How is memory allocated i, Rashmi Rubdi | Date | Re: [xsl] How is memory allocated i, Rashmi Rubdi | 
| Month |