XML technologies / XSLT / Introduction to XSLT 2.0 / Getting started with XSLT and XPath / Stylesheets with multiple templates
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, Chapter 1.)
The stylesheet examined so far has only one processing rule, activated by the document node. Usually, however, a stylesheet contains multiple template rules. In simple cases, all processing can be performed within one template, but this quickly reaches its limits. Distributing tasks across multiple templates is also simpler and clearer.
Remember:
Each template rule should be kept as simple as possible. This makes debugging a stylesheet easier and also facilitates reusing individual template rules in other stylesheets.
Copyright © Galileo Press, Bonn 2008
You may print the online version for your private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the printed edition: the work and all its parts are protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn