For a good many XSLT applications you will find yourself working with different combinations of source, stylesheet, and result documents.
Because numerous development tasks are performed repeatedly, it makes sense to divide your stylesheets into reusable modules. You will also encounter cases where content can be reused, especially when that content takes the form of structured data, or is related to creating common web-page output like menus or footers.
You will also sometimes want to override rules in an existing stylesheet. By importing code into a new stylesheet, you can selectively customize it.
Finally, sometimes you'll need to produce multiple result documents, perhaps dividing a long document into smaller ones, or archiving content in one format while publishing in another.
In this chapter you'll take a look at ways to deal with all three circumstances. You'll learn how to do the following:
Create and include modular stylesheets.
Override existing stylesheets by importing them into a new one that provides alternative parameters, variables, and template rules.
Load multiple XML sources using a single XSLT and XPath function, which will load one or more additional XML sources.
Build temporary trees using
Create multiple result documents with
Writing stylesheet modules to contain frequently used code is a time-saving practice. It is also the case that stylesheets can become quite long and complex, ...