Name
<xsl:output>
Defines the characteristics of an output document.
Category
Top-level element.
Required Attributes
None.
Optional Attributes
methodTypically has one of four values:
xml,html,xhtml, ortext. This value indicates the type of document that is generated. An XSLT processor can add other values to this list; how those values affect the generated document is determined by the XSLT processor. The default value isxmlunless the root element of the output document is<html>.[1.0] In XSLT 1.0, there are only three output methods defined in the standard:
xml,html, andtext. [2.0] In XSLT 2.0,xhtmlhas been added as an output method that must be supported by an XSLT processor. Individual processors are still free to add other values as well. To simplify our discussion here, we’ll discussxhtmlas one of the standard output types without constantly reminding you that it’s not available in XSLT 1.0.versionDefines the version of the XML, HTML, or XHTML output document. This attribute is ignored with
method="text".Note
The
versionattribute of the<xsl:output>element works differently from theversionattribute that is legal on every XSLT element in XSLT 2.0. See “[2.0] Attributes common to all XSLT elements” earlier in this appendix for more details.encodingDefines the value of the
encodingspecified in the XML declaration in the output document. This attribute is ignored withmethod="text".omit-xml-declarationDefines whether the XML declaration is omitted in the output document. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access