We have been trying to determine whether using XSL:For-Each is having an
impact on the speed of our document publishing. Some of my buddies don't
want to use xsl:for-each because they believe it causes the process to take
a longer amount of time than just doing a template match over and over. Is
this true or no? Is xsl:for-each a performance hog or does it and template
matching take the same amount of time?
I believe that's quite opposite - for-each is only about to evaluate
expression and instantiate instructions within for each selected node, but
using apply-templates it's also nessesary to match appropriate template,
probably to up new stack frame etc. That's usually not much overhead, but it
does exist and depends on the processor implementation.