Re: [xsl] apply template

Subject: Re: [xsl] apply template
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 24 Aug 2004 16:26:40 -0400
At 09:59 AM 8/24/2004, Bruce wrote:
Jan, try this (note I got rid of the for-each and explicit template select, which you really only want to do if you need to reorder content as far as I understand):

Really you don't even need to use for-each at all: it's nothing more than a convenience, since you could do everything it does with another template in its own mode. Even reordering content can be done as effectively with templates.


Depending on for-each is an easy trap to fall into: it seems easier and more straightforward than templates, but it's really no different. Using it sometimes allows newbies to get away without learning how templates work (for a while) -- which is the same as preventing you from learning how the language works.

Note that anything you could do with for-each, you can do with templates. But templates are much more versatile and generally useful than for-each.

Cheers,
Wendell

___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau


Current Thread