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
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format