Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
The XHTML output method also inherits two specific features of the HTML output method:
You can control whether an XML declaration is output using theomit-xml-declaration
attribute. The XHTML 1.0 specification advises against using an XML declaration, but points out that under the XML rules, it may be omitted only if the encoding is UTF-8 or UTF-16.
The Text Output Method
When you specifymethod=“text”
, the result tree is output as a plain text file. The values of the text nodes of the tree are copied to the output, and all other nodes are ignored. Within text nodes, all character values are output using the relevant encoding as determined by the
encoding
attribute; there are no special characters such as&
to be escaped.
The way in which line endings are output (for example LF or CRLF) is not defined; the implementation might choose to use the default line-ending conventions of the platform on which it is running.
The attributes that are relevant to text output are listed below. All other attributes are ignored.
Attribute | Interpretation |
encoding | This specifies the preferred character encoding for the output document. The default value is implementation-defined, and may depend on the platform on which it is running. If the encoding is one that does not allow all XML characters to be represented directly, for example ![]() ![]() |
media-type | This parameter defines the media type of the output file (often referred to as its MIME type). The default value is![]() ![]() |