[Home] [By Thread] [By Date] [Recent Entries]
The use of xsl:apply-templates is considered better approach than <xsl:for-each> <xsl:for-each> (also called "pull processing") only works if you know exactly the structure of the XML that your stylesheet is going to process. But <xsl:apply-templates> is far more flexible. It defines rules for processing each kind of element wherever it occurs. This makes the stylesheet more resilient to changes in the source document structure, and better able to deal with semi-structured information where elements may occur in many different places. It also enables you to build up a library of template rules that can be re-used for many different transformations of many different document types. ---- This is taken from archives..(Michael Kay's Answer to the question of <xsl:for-each> or<xsl:appy-templates>?? From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: XSL: For-Each Efficient or Not? Date: Mon, 01 Jul 2002 16:31:41 +0200 _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|

Cart



