An XSLT processor may output the result tree as a sequence of bytes, although it is not required to be able to do so (see [17 Conformance]).
The xslutput element allows stylesheet authors to specify how they wish the result tree to be output. If an XSLT processor outputs the result tree, it should do so as specified by the xslutput element; however, it is not required to do so.
The xsl
utput element is only allowed as a top-level element.
The method attribute on xsl
utput identifies the overall method that should be used for outputting the result tree. The value must be a QName. If the QName does not have a prefix, then it identifies a method specified in this document and must be one of
xml,
html or text. If the QName has a prefix, then the QName is expanded into an expanded-name as described in [2.4 Qualified Names]; the expanded-name identifies the output method; the behavior in this case is not specified by this document.
The default for the method attribute is chosen as follows. If
the root node of the result tree has an element child,
the expanded-name of the first element child of the root node (i.e. the document element) of the result tree has local part
html (in any combination of upper and lower case) and a null namespace
URI, and
any text nodes preceding the first element child of the root node of the result tree contain only whitespace characters,
then the default output method is
html; otherwise, the default output method is
xml. The default output method should be used if there are no xsl
utput elements or if none of the xsl
utput elements specifies a value for the method attribute.