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

Subject: Re: [xsl] Is xsl:for-each "syntactic sugar"?
From: "C. M. Sperberg-McQueen" <cmsmcq@xxxxxxxxxxxxxxxxx>
Date: Fri, 7 May 2010 12:08:58 -0600
On 7 May 2010, at 11:36 , Dimitre Novatchev wrote:

It may be that (as Dimitre Novatchev suggests)
for-each may run faster. And so if you run into performance problems,
consider trying it. (But remember Jon Bentley's first rule of program
optimization: don't do it until you know you need to do it.)


I didn't suggest that "for-each" may run faster.

I said that iterative constucts may be implemented more efficiently.
(This is a general statement and we all know that efficiency varies
accross implementations.)

Sorry. Quite right, my paraphrase was careless and I thank you for the clarification.

This by no means should be interpreted as a recommendation to choose
<xsl:for-each> over <xsl:apply-templates>.

That's a relief!


To repeat once again my statement: Choose an iterative construct over
*explicit* recursion, if this is possible.

Amen.


--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************

Current Thread