Re: [xsl] Re: _why_ do people use xsl:element and xsl:attribute so much

Subject: Re: [xsl] Re: _why_ do people use xsl:element and xsl:attribute so much
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 05 Sep 2001 19:09:43 -0400
At 06:30 PM 9/5/01, David wrote:
But I think that it _is_ natural to say that a template body can be
viewed as a fragment of the output tree, and that the most natural way
to express a tree structure in XML is to use the standard XML
representation of that tree, thus
<a href="...">...</a>
for an a element with an href attribute. (where actually one uses
xslt/xpath rather than ... to fill out the blanks.

This is fair enough, as long as one has made the leap from looking "at" the markup to looking "through" the markup, seeing the tree model behind it. Sometimes I tell students that that's when they know they're really starting to think in XSLT, when they no longer see text and tags, but rather a nested element structure that just happens to have tags as delimiters. But how can a new user most quickly get to and make that leap?


On the other hand the comments from a tool author on the utility of the
more regular xsl:element constructs sounded reasonable, tool generated
sheets, and setting breakpoints etc does seem to have different
requirements/flavour than hand authoring.

Absolutely, and I'm glad he chimed in, since the reasonableness given that set of requirements really justified the practice (whereas otherwise it seemed at best, an implementation shortcut, at worst bizarre and lazy).


It's interesting how differently the language looks (at least syntactically) when approached this way. SVG also shows a sizable gap between hand-authored, hand-tuned documents, and documents generated by a GUI. I guess whether it's better to start learning "the hard way" (using emacs or -- gasp! -- vi) or "the easy way" (choose your mapper/template-generator), will always be a pedagogical issue, and may not have a Right Answer.

In any case, I think we're agreed that an XSLT developer does need to learn to see through the markup-based syntax, into the actual workings of the language, if she or he is to gain any real facility. Do xsl:element and xsl:attribute help with that? I suppose they might -- but again, depending on the learner.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread