11.2 Programming in XSLT 265
Figure 11.3 The digestion process during XML transformation. The first template
digests achromosomeelement and then releases thelocuschild elements to the
second template. The corresponding action on the hierarchy is to change the context
from thechromosomeelement to thelocusas shown in the screen image.
- After transforming the matching element or attribute, a template can ap-
ply other templates to continue the transformation.
11.2 Programming in XSLT
Every XSLT template acts within acontext. When one is using an XML editor,
the context is the element (or attribute) that is currently highlighted. One
selects context in an XML editor by clicking the mouse on the desired element
in the hierarchy or by clicking on a data entry box for an attribute. In the
same way, thexsl:apply-templateschanges the transformation context
from one element or attribute to another.
The context for an XML editor is selected by a person using a mouse. The
selection can occur wherever the person expresses an interest. The context for
an XML transformation is more systematic. Elements are normally selected
by reading the document from the beginning to the end, just as one would