RE: [xsl] What's your visual metaphor for XSL Transformations?

Subject: RE: [xsl] What's your visual metaphor for XSL Transformations?
From: "W Charlton" <XSLList@xxxxxxxxxx>
Date: Wed, 21 Mar 2007 09:29:21 -0000
When working with XML/XSLT transforms I work with a mental image of a multi
branched structure, a bit like a tree or a root system.

When working with an element or attribute I have a mental awareness of where
I am in the "branch" with relation to the other "branches" that I am trying
to access or manipulate.

Without an awareness of where you are at any point in the transform it is
easy to get odd or unexpected results.

Most XML in my experience is fairly simple in its structure so the tree
analogy holds. Sometimes however XML can be complex and you have to be aware
of the depth and scope of where you are in the hierarchy. The tree analogy
still holds, it is just a bigger tree!

I disagree with the infinity and Ouroboros analogies as these imply either
that XML is infinitely deep (although in theory it can be, it never is
because this is the real world, so it is always finite) or that there is
some self reference or recursion in the XML, this is not true as XML is
hierarchical.

N.B. there may be some implied self-reference by the XML author but that is
not the same.

Whilst holding a mental picture of your "tree" structure it is also useful
to have a good idea of the "depth" of any child branch you are working on in
relation to the common branch of any other branch you may be referencing.
The common branch is the point at which the two siblings (or ancestors)
diverge.


A good visual analogy is to think of ants walking up and down an apple tree
(or other host plant) to "farm" aphids.

C.F. http://www.plantpath.cornell.edu/PhotoLab/PicOfMonth/POM4.htm

If ants had a mental "map" of where the aphids were that they were tending,
then their "map" would be something like your mental "map". 
If they go down a branch, the only ways (without jumping which you can't do
in XSL) to get to a "sibling" branch would be to backtrack and go up the
sibling "branch" or fall off and start again at the root.


William Charlton
The yMonda team
yMonda Limited
w: www.ymonda.net

Current Thread