xsl-list
[Top] [All Lists]

Re: xsl:for-each vs. xsl:apply-templates

2004-11-11 04:43:12
On Wed, 10 Nov 2004 12:53:35 -0500, Wendell Piez
<wapiez(_at_)mulberrytech(_dot_)com> wrote:
Hi Osman,

Always use xsl:apply-templates, unless you see that this requires you to
create a new mode that will be used once only, in which case you can use
xsl:for-each instead as "syntax sugar".

It's not quite that simple, but almost ... 

I strongly agree...

xsl:apply-templates is much richer and deeper than xsl:for-each, even
simply because we don't know what code will be applied on the nodes of
the selection -- in the general case this code will be different for
different nodes of the node-list. Also, the code that will be applied
can be written way after the xsl:apply templates was written and by
people that do not know the original author.

Cheers,
Dimitre.

P.S. Don't know why this reminds me of a statement someone made on
xml-dev that XQuery was a "superset of XSLT 2.0" ... ??

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