This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: RE:"*NEVER* use for-each"


I don't see what that has to do with for-each.  Someone can put a // or
//*[@...] into an apply-templates.  With the same xpath expression, for-each
is always faster than apply-templates.  

-----Original Message-----
From: Chris Bayes [mailto:Chris@Bayes.co.uk]
Sent: Tuesday, February 27, 2001 4:11 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] RE:"*NEVER* use for-each"


>for-each is part of the xslt specification.  It does not break anything
>about the programming model because it is, by definition, part of the xslt
>programming model. It is no more or less natural than apply-templates. Each
>provides useful functionality. In msxml3, for-each is slight more effecient
>than using apply-templates because apply-templates adds the additional cost
>of xpath matching.

Yup. But before you know it someone is going to put a // or a //*[@...] etc
in your highly efficient <xsl:for-each> thinking they are just drilling down
from the top level or omnipotent and your performance is going to go though
the floor. This is less likely to happen with templates because you know
where you are or more importantly you don't care where you are.

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]