Re: [xsl] RE:"*NEVER* use for-each"

Subject: Re: [xsl] RE:"*NEVER* use for-each"
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Tue, 27 Feb 2001 19:01:25 +0000

Chris Bayes wrote:

> Next he will be asking how he can increment his $Index variable which he
> can't do because you can't increment variables without using recursion. As
> he hasn't got the hang of templates yet explaining to him how to do
> recursion is not going to be easy.
> To quote Francis in another thread
> >People on this list find themselves bailing out people who've sailed on
> >to the same old rocks, and try to let others know that they're sailing
> >in that direction, that why we make suggestions of this kind.
*grrrk* (sound of Francis being hoist by own petard)

I hadn't offered an opinion on the advice, but I did use for-each to
answer the question. 

For the record I pretty much agree with Steve Muench's analysis
elsewhere on this thread. I use for-each a lot because I am doing
transforms on highly predictable financial transaction data. I haven't
thought about this in depth, but I think I'm more likely to use for-each
in complexity-increasing transforms, eg statement-query-result (where
the structure is optimised for re-use) -> page-formatted-SVG, whereas
I'm perhaps more likely to use template matching in
simplicity-increasing transforms, like extracting documentation data
from a networked data model (like XML Schema). I normally use for-each
for simple schema->schema transforms, but I haven't considered this
choice in depth.

But I would agree that any beginner needs to use and understand
templates as well as for-each.


 XSL-List info and archive:

Current Thread