[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

Subject: Re: xsl:for-each vs. xsl:apply-templates
From: Dimtre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 11 Nov 2004 22:43:12 +1100
xsl for each apply templates
On Wed, 10 Nov 2004 12:53:35 -0500, Wendell Piez
<wapiez@xxxxxxxxxxxxxxxx> 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" ... ??

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.