xsl-list
[Top] [All Lists]

Re: [xsl] Diagramming XSLT

2008-04-16 03:58:38
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James,

coming back to one "older" thread:

When I explain XML/XSLT to non-programmers (and sometimes even computer
illiterates) quite regularly, I consider three views helpful, especially
taking into consideration Wendell's statement:


As for how to approach it, if what you're trying to get across is the
processing model and the basic notion of matching templates and
generating results, diagrams may actually be a hindrance, since the
"flow" of the stylesheet as it matches one node and then another is
going to be quite complex on anything but the most trivial and
unrepresentative cases. People's brains don't recurse well past about
four levels without help (even those of us who like the idea of
recursion). We're much better with iteration.


The views are:

1. XML/XSL is organized like a "matrushka" (everything nests; showing an
image of a matrushka might be visualization enough!). You can organize
both content and processing this way. Processing the xslt means to
(virtually) nest the templates (called ex- or implicitely). Thus you
only need to show two levels, the rest is up to imagination.

2. Look at the XML/XSLT file like a SAX parser would do: reading a start
tag means to open another (matrushkanian) level (XML) or to apply
another template (XSL). Reading a closing tag means to get back to the
last level.

3. Look at the XML/XSLT file like a DOM parser would do: Traverse the
tree applying two rules: a) go left as far as you can; b) if a) is not
possible go back until you find a sibling, go right and apply rule a)
again. That sometimes things are stored in variables or params and taken
with them on the way shouldn't increase the difficulties to understand
the paradigm to much.


If you find this helpful and a way to visualize it, please let us know. ;-)

Best, Torsten



- --
Torsten Schassan
Herzog August Bibliothek, Postfach 1364, D-38299 Wolfenbuettel
Tel.: +49-5331-808-130, schassan {at} hab.de
http://www.hab.de; http://www.hab.de/forschung/projekte/weiss64.htm
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIBduPq4nZEP2KS4QRAuOHAJ4uHSEd5d1dhML4bwdmwGiWBBp6XgCfdd2r
DWCqUomzz3rhv6C0+mNJglw=
=BdPy
-----END PGP SIGNATURE-----


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>