Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Developer's Guide

Processing Template Rules

When the XSLT processor begins to process the XSLT tree, the processor looks for the template rule that points to the document root element in the source tree.

At its simplest, the template rule that points to this root element is as follows:

<xsl:template match="/firstelement">

Here the value of the match pattern indicates that this rule applies to the first element (represented by firstelement) of the root node (represented by the slash, /). In the Sample XML File (books.xml), the simplest template rule that points to the document root element is the following:

<xsl:template match="/catalog">

After the XSLT processor locates this initial template rule, the processor evaluates the rule and proceeds as follows:

Controlling Processing

As you might have noticed, the processing of an XSLT file is not procedural like it is in most programming languages. That is, the XSLT processor does not sequentially process each template rule as it appears in the XSLT tree.

Under certain circumstances, however, the sequence in which the style sheet is processed can be determined, and to a limited extent controlled:

Handling Template Rule Conflicts

While processing an XSLT tree, the XSLT processor might encounter a conflict that must be resolved:

See Also

The XSLT Processor