Appendix C. XSLT Processing Model

Looked at in the abstract, the XSLT processing model can appear quite complex. I think the model is much easier to understand after you have gained some knowledge about XSLT and XPath.

This appendix expands on the brief outline of XSLT processing contained in the introduction and relates it to information that you have already encountered in several chapters of this book. While it does not contain significant new information, I hope it will draw together what you have learned in a convenient review format.

In outline, an XSLT processor parses an XML source document and a stylesheet into a source tree, applies a transform to create a result tree, and serializes the content in the specified output format.

Quite often, the process is rather more complex. Multiple source documents can be loaded, and stylesheets may be provided in modules. There may be more than one result, and multiple serializations.

In every case, each document is processed as a separate tree. Initially, a source tree is created for each input and the transformation takes place, creating one or more result trees. Finally, the result trees are serialized to one or more of the possible output formats.

The Data Model

Often the source, the stylesheet, and the result documents are in XML format. But because other input and output formats, MTML, XHTML, and text are supported, it does not make sense to use XML as an internal representation, and to possibly convert to and from XML in addition to ...

Get Beginning XSLT and XPath: Transforming XML Documents and Data now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.