[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xsl:for-each vs. xsl: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" ... ??
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|