XSLT xsl:output Element
Complete XSLT Element Reference Manual
Definition and Usage
xsl:output The element defines the format of the output document.
Note:xsl:output is a top-level element and must be xsl:stylesheet or xsl:transform child node.
Syntax
method="xml|html|text|name" version="string" encoding="string" omit-xml-declaration="yes|no" standalone="yes|no" doctype-public="string" doctype-system="string" cdata-section-elements="namelist" indent="yes|no" media-type="string"/> Netscape 6 仅支持 "html" 和 "xml"。 | version | string | Optional. Sets the W3C version number of the output format. (Used only when method="html" or method="xml"). | | encoding | string | Optional. Sets the value of the encoding attribute in the output. | | omit-xml-declaration | yes
Netscape 6 does not support this attribute. Netscape 6 does not support this attribute. Netscape 6 does not support this attribute. In this example, the output is an XML document, version 1.0. The character encoding is set to "ISO-8859-1", and the output is indented for greater readability: xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> encoding="iso-8859-1" indent="yes"/> ... ... In this example, the output is an HTML document, version 4.0. The character encoding is set to "ISO-8859-1", and the output is indented for greater readability: xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> encoding="iso-8859-1" indent="yes"/> ... ...property
property
Value
Description
method
xml
html
text
name | 可选。定义输出的格式。默认是 XML(但是如果根节点的第一个子节点是 ,且在这之前没有文本节点,则默认是 HTML)。
no | Optional. "yes" specifies that the XML declaration () is omitted from the output. "no" specifies that the XML declaration should be included in the output. Default is "no". | | standalone | yes
no | Optional. "yes" specifies that the XSLT processor should output a standalone document declaration. "no" specifies that the XSLT processor should not output a standalone document declaration. Default is "no".
no | Optional. "yes" specifies that the output should be indented according to its hierarchical structure. "no" specifies that the output should not be indented according to its hierarchical structure.
Example 1
Example 2
Complete XSLT Element Reference Manual