On 5/2/07, Michael Kay <mike(_at_)saxonica(_dot_)com> wrote:
> -Xss###k did not
> help anything, which makes me believe that the maximum
> recursive depth is enforced by Saxon somehow.
>
Initially I too thought -Xss didn't work, but it works on Saxon.
So I tried
java -Xss8192k -jar c:\dev\saxonb8-9-0-3j\saxon8.jar -it mainTemplate
recursion.xsl
with this stylesheet
<?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:output omit-xml-declaration="yes"/>
<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>
</xsl:stylesheet>
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
I tested the above on java version "1.6.0_01"
Please note that -Xss8192k is not the ~minimum~ required memory to run
the above factorial.
I think the minimum would be lower, but I still need to approximate it.
Michael Kay
http://www.saxonica.com/
-Regards
Rashmi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--