Hi,
It works with nodes too although, depending on how you use it, you may want to add a document node as a standard variable would have but assignables do not.
ac


At 21:11 2005-06-14, you wrote:
Thanks. Good to know. I assume this works with nodes, not just integer. I'll check it out. If it improves performance compared to recursion, I'd be especially happy.

Roger Kovack

Andre Cusson wrote:
Hi,
    < xsl:variable name= "tradePartCount"   as= "xs:integer" select= "20" / >
    < xsl:variable name= "topCurTradePart" select= "0" saxon:assignable= "yes" / >
    < saxon:while test= "$topCurTradePart lt $tradePartCount" >
        < saxon:assign name= "topCurTradePart" select= "$topCurTradePart+1" / >
        < xsl:message >< xsl:value-of select= "$topCurTradePart" / >< /xsl:message >
    < /saxon:while >

This works fine here with 8.4
ac



At 19:40 2005-06-14, you wrote:
I have seen this error with Saxon8.2 but it is not a problem with Saxon7.8. My doc is about 30Kb that recurses about 115 times. This all runs fine in 100Mb of memory space on Win2K server.

I agree with you in that certain Saxon behavior introduced recently has threatened my existence. My entire product and company is based on the Saxon transform engine. I believe that XSL is *the way* to produce complex web applications. I have no choice but to continue using Saxon7.8 and carefully lift code from later versions to fix bugs.

I agree that Saxon is at the sole discretion of Mike Kay. I'm sure he understands that there is a vast installed base that depends on backward compatibility. In retrospect, backward compatibility is one of the toughest things that MS, for instance, has to deal with. I respect Mike Kay and anyone that has to balance that with the fruits of progress.

Roger Kovack

Alan Painter wrote:
Hello,

I've been using Template recursion in order to iterate over the N instances
of a node in a big input document, each node creating a separate result-document.

Haven't had any problem to date, even with big files (100Mo) and around 100 output documents.

But I just ran into a case of "StackOverflowError":

SXLM0001: Too many nested apply-templates calls. The stylesheet is probably looping.

Sure, it's looping, but over the nodes that I need to output, not in error.

So I thought that I'd try the Saxon extensions that allow iteration, to wit the "saxon:while"
extension and the "saxon:assignable" attribute to xsl:variable, along with "saxon:assign".
I noticed that the 8.4 documentation says that "saxon:assign" may go away in the future.
However, in spite of repeated attempts and tweaks, I couldn't get saxon:assign to work:
my global variable remained a constant value:

    <xsl:variable name="tradePartCount"  as="xs:integer" select="count($tradeParts)"/>
    <xsl:variable name="topCurTradePart" select="0" saxon:assignable="yes" />

    <saxon:while test="$topCurTradePart lt $tradePartCount">
        <saxon:assign name="topCurTradePart" select="$topCurTradePart+1"/>
        <xsl:call-template name="makeATradePart"/>
    </saxon:while>

Note: I tried both the "select" and "expr" attributes to saxon:assign.

So I'm in a corner and I'm curious what I should do:

-- Try to pursue the "saxon:assign" workaround, in the hopes of making it work
-- Modify a configuration (which?) in order to keep from having StackOverFlow exception in a normal recursion.

Thanks for pointers.

-alan
------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________ saxon-help mailing list saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help
------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________ saxon-help mailing list saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help