that we have seen an example, let’s back up and talk about some
basics. In particular, it is important to understand the relationship
<xsl:apply-templates select=...>. This should help to solidify your
understanding of the previous example and lay the groundwork for more
sophisticated processing. Although XSLT is a language, it is not
intended to be a general-purpose programming language. Because of its
specialized mission as a transformation language, the design
of XSLT works in the way that XML is structured, which is
fundamentally a tree data structure.
XML Tree Data Structure
well-formed XML document forms a
tree data structure. The document itself is always the root of the
tree, and every element within the document has exactly one parent.
Since the document itself is the root, it has no parent. As you learn
XSLT, it can be helpful to draw pictures of your XML data that show
its tree structure. Figure 2-2 illustrates the tree
Figure 2-2. Tree structure for discussionForumHome.xml
The document itself is the root of the tree and may contain processing instructions, the document root element, and even comments. XSLT has the ability to select any of these items, although you will probably want to select elements and attributes when transforming to HTML. As mentioned earlier, ...