xsl-list
[Top] [All Lists]

RE: [xsl] Is xsl:for-each "syntactic sugar"?

2010-05-07 01:27:45
1. Everything that can be done using xsl:for-each can be done using a
recursive function. (True or False)

This is not true since in reality the stack size limiting the number of
recursions is much more limited than the width of your CPU limiting the
number of iterations. So you can do much more loops than iterations.
Also, xsl:for-each is much easier to understand than a potentially
complex recursive function (you SEE that it is a loop, while you have
NOTICE that it is recursive). Also, xsl:for-each can (in theory) be
implemented using parallel execution (multiple cores) while recursion
necessarily must be a single core as it is up to the coder where / when
in his particular algorithm the recursive call takes place.

3. xsl:for-each is syntactic sugar. (True or False)

False, see above.

4. Favor recursive functions over xsl:for-each. (True or False)

Totally wrong, as it is much more complex to read and understand as a
simple loop.

Regards
Markus

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