[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: RE: Is xsl:for-each "syntactic sugar"?
From: "Markus Karg" <karg@xxxxxxxxx>
Date: Fri, 7 May 2010 08:27:18 +0200
RE:  Is xsl:for-each "syntactic sugar"?
> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.