xsl-list
[Top] [All Lists]

Re: xsl recursion

2005-02-23 13:06:16
The code you posted at comp.text.xml will really cause infinite recursion.

There is no correct stop condition. 

You test for 
         $rowcount = 2

but there isn't any test for 
        $rowcount = 1


If $rowcount = 1

then you divide it by 2 and get the next two calls with $rowcount = 0
and $rowcount = 1
and this goes on forever.


Cheers,
Dimitre Novatchev


On Thu, 24 Feb 2005 06:54:22 +1100, Dimitre Novatchev
<dnovatchev(_at_)gmail(_dot_)com> wrote:
I need to use
a divide a conquer algorithm for parts of the document for comparing
previous node values (date differencing)
and building a stream of floating point values.

The code you provided doesn't contain any date differencing -- instead
it just copies individual elements ???

Cross-posting to newsgroups will not help -- it is even more
confusing, as you have provided different (although more meaningful)
code in comp.text.xml

If one wants to be helped, he must respect the time of the people
wanting to help, by providing the right (smallest possible information
that still correctly describes the problem) data.

I suspect that you do not have a correct stop condition, which of
course can't be proven until you have provided the real code.

One last node is that the DVC approach, when used correctly, reduces
the maximum recursion depth and thus prevents typical stack overflow
due to too-deep recursion. DVC, however, cannot help in other memory
consumption problems.

Cheers,
Dimitre Novatchev


--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>