Output formats

Output from an XSLT processor can be customized in a number of ways. The Output element is an empty element, but has attributes that specify various requirements for formatting of the output:

<output ... />

The Method attribute controls fundamental formatting characteristics that are required for XML, HTML and text output. It holds the value 'xml', 'html' or 'text' accordingly. The implications of these settings are described in later chapters. By default, the setting is 'xml', except when an HTML document is recognized by its root element name ('<HTML>'). The Version attribute supports this feature and is used, for example, to indicate which version of HTML to output:

<output ... method="html" version="3.2" />

The Encoding ...

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.