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

RE: <xsl:apply-templates> or <xsl:for-each> ??

Subject: RE: <xsl:apply-templates> or <xsl:for-each> ??
From: Jarno.Elovirta@xxxxxxxxx
Date: Thu, 21 Mar 2002 15:19:44 +0200
xslt for each apply templates
Hi,

> I am really very much confused regarding when you make use of 
> <xsl:apply-templates> and when you make use of <xsl:for-each>
> since i come from a programming background, it makes more 
> sence for me to 
> use <xsl:for-each> as I can imagine each node that is 
> processed in a loop .

Yes, but it's not a loop. You select a set of nodes and then process them in document order.

> But technically <xsl:apply-templates> seems to be doing the same job.
> can some one advice me as to when exactly do we make use of 
> <xsl:apply-templates> and when <xsl:for-each> is best used??

I suppose it's a matter of taste, but if you're a beginner, I'd suggest you use xsl:apply-template with templates to first fully understand how XSLT processing works. Then, when you're comfortable with it, you'll probably understand yourself when xsl:for-each makes your life easier and when to stick with xsl:apply-templates.

Santtu

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


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.