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

The XSLT Processor

The XSLT processor works with a source tree, applies a style sheet tree to the source tree, and produces a result tree. The source tree and the result tree are the XML DOM for the source XML file and the XSLT style sheet, respectively. The trees are produced by the MSXML parser.

The following illustration shows the processing relationship among the XSLT processor, XSLT tree, source tree, and result tree. Click on a colored area in the illustration to find out about that particular part of this relationship.

Parsing the Documents into Trees

MSXML parses the source file and XSLT file into a source tree and an XSLT tree, respectively. Parsing the source file into a tree is critical, because the XML Path Language (XPath) is not able to navigate a source document directly. XPath treats XML documents as trees with interrelated nodes. Therefore, by parsing a source document into a tree, XSLT is able to use XPath to navigate that tree.

Part of the parsing process is to check the documents to make sure they have well-formed XML. Processing stops with an error message if the document is not well-formed.

Transforming and Outputting Data

The XSLT processor begins the transformation process by looking at the transformation information stored in the XSLT tree. This transformation information is in the form of template rules.

As the XSLT processor processes the template rules, it outputs the transformed data into a result tree. This result tree can be either XML or any other structured text content, such as HTML, comma-separated-values (CSV) flat files, or rich text format (RTF) documents.

See Also

Working with a Source Tree | Processing Template Rules | Linking to an XSLT File