xsl-list
[Top] [All Lists]

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

2010-05-07 13:09:24

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





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