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

Subject: RE: [xsl] RE:"*NEVER* use for-each"
From: "Evan Lenz" <elenz@xxxxxxxxxxx>
Date: Tue, 27 Feb 2001 16:13:50 -0800
David Rigby wrote:
> the big problem is that using for-each very early on hinders
> learning about the uses of the default template behaviour.

I agree that encouraging beginners to use template rules will help prevent
later confusion about built-in template rules, etc. But there may be another
reason why xsl:for-each should be learned first...

In the XQuery vs. XSLT debate, my impression is that the difficulty of
template rules and the verbosity of XSLT's syntax are what provoke many
knee-jerk negative reactions to the suggestion of using even a subset of
XSLT as a query language. If the W3C ends up using a common semantic core
between XQuery and XSLT, extending beyond XPath into equivalent flow control
constructs, etc., then an understanding of xsl:for-each, etc., without
learning template rules at all would be useful as a start to learning not
only XSLT, but XQuery as well. My claim on xml-dev was that such reuse would
be appropriate and beneficial for XML developers coming from either
document- or data-oriented backgrounds.

Normally, I think template rules need to be explained up front and
thoroughly, yet with the introduction of XQuery, there may be a stronger
case for at first learning only xsl:for-each, etc. if that body of knowledge
could be applied to both XSLT and XQuery (where template rules probably will
not apply).

Evan Lenz
XYZFind Corp.

 XSL-List info and archive:

Current Thread