Subject: Re: [xsl] XSLT Dead? From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 17 Apr 2007 21:35:01 +0200 |
At 2007-04-17 15:02 -0400, Steve wrote: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.
Think "pull" and "push".
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?
With for-each one pulls nodes from the source tree and the instruction supplies the one result tree construction rule used for all nodes pulled.
With apply-templates one pushes nodes from the source tree at the stylesheet and the processor finds the template rule with the result tree construction rule for each individual node pushed.
These characterizations seem to be received well by my students.
Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT Dead?, Andrew Welch | Thread | Re: [xsl] XSLT Dead?, Dimitre Novatchev |
Re: [xsl] XSLT Dead?, Dimitre Novatchev | Date | Re: [xsl] XSLT Dead?, David Carlisle |
Month |