Subject: Re: [xsl] XSLT Dead? From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> Date: Tue, 17 Apr 2007 12:23:14 -0700 |
This one has me kind of stumped. Maybe I'm one of these people. What is the difference between for-each and apply-templates? I have a hard time even mentally comparing the two.
One function iterates through a node set and the other matches up a template with a node based on a given context or passed mode. Is that the right answer, or close to it?
This is only what it seems on the surface -- going in depth reveals a lot more fundamental differences and what actually are the benefits of using xsl:pply-templates.
These benefits are actually the benefits of fully undrstanding and using the features of the XSLT Processing Model.
"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 Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT Dead?, Abel Braaksma | Thread | Re: [xsl] XSLT Dead?, Steve |
Re: [xsl] XSLT Dead?, G. Ken Holman | Date | Re: [xsl] XSLT Dead?, Abel Braaksma |
Month |