How Does XSL Work?
Before discussing XSL in more detail, it’s necessary to consider the XSL processing model. An XSL processor begins with a style sheet and a “source tree.” The source tree is the tree representation of the parsed XML source document. All XML documents can be represented as trees. Conceptually, the XSL processor begins at the root node in the source tree and processes it by finding the template in the style sheet that describes how that element should be displayed. Each node is then processed in turn until there are no more nodes left to be processed. (In fact, it’s a little more complicated than this because each template can specify which nodes to process, so some nodes may be processed more than once and some may not be processed at all. We’ll examine this later.) The product of all this processing is a “result tree.” If the result tree is composed of XSL formatting objects, then it describes how to present the source document. It’s a feature of XSL that the result tree doesn’t have t