Embedded stylesheets

The opposite of splitting separate stylesheets into multiple units is the concept of embedding an entire stylesheet within an XML document to be formatted. The Stylesheet (or Transform) element can be embedded within other XML structures, allowing a document to contain the stylesheet that is to be applied to it.

This may not be a popular technique, as in practice it is usual for a single stylesheet to be applicable to many documents, and it would not be efficient for each document to contain copies of the same stylesheet. However, a document and an applicable stylesheet could be packaged for delivery to a publishing system using this technique.

It is not sufficient simply to embed a Stylesheet element in a larger document, ...

Get XSL companion, The 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.