選單
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

XML 教程

XML 主頁 XML 簡介 XML 如何使用 XML 樹 XML 語法 XML 元素 XML 屬性 XML 名稱空間 XML 顯示 XML HttpRequest XML 解析器 XML DOM XML XPath XML XSLT XML XQuery XML XLink XML 驗證器 XML DTD XML Schema XML 伺服器 XML 示例 XML 測驗 XML 證書

XML AJAX

AJAX Introduction AJAX XMLHttp AJAX Request AJAX Response AJAX XML File AJAX PHP AJAX ASP AJAX Database AJAX Applications AJAX Examples

XML DOM

DOM Introduction DOM Nodes DOM Accessing DOM Node Info DOM Node List DOM Traversing DOM Navigating DOM Get Values DOM Change Nodes DOM Remove Nodes DOM Replace Nodes DOM Create Nodes DOM Add Nodes DOM Clone Nodes DOM Examples

XPath 教程

XPath Introduction XPath Nodes XPath Syntax XPath Axes XPath Operators XPath Examples

XSLT 教程

XSLT Introduction XSL Languages XSLT Transform XSLT <template> XSLT <value-of> XSLT <for-each> XSLT <sort> XSLT <if> XSLT <choose> XSLT Apply XSLT on the Client XSLT on the Server XSLT Edit XML XSLT Examples

XQuery 教程

XQuery Introduction XQuery Example XQuery FLWOR XQuery HTML XQuery Terms XQuery Syntax XQuery Add XQuery Select XQuery Functions

XML DTD

DTD Introduction DTD Building Blocks DTD Elements DTD Attributes DTD Elements vs Attr DTD Entities DTD Examples

XSD Schema

XSD 簡介 XSD 如何操作 XSD <schema> XSD 元素 XSD 屬性 XSD 限制 XSD 複雜元素 XSD 空 XSD 僅元素 XSD 僅文字 XSD 混合 XSD 指示符 XSD <any> XSD <anyAttribute> XSD 替換 XSD 示例

XSD Data Types

XSD String XSD Date/Time XSD Numeric XSD Misc XSD Reference

Web Services

XML Services XML WSDL XML SOAP XML RDF XML RSS

參考手冊

DOM 節點型別 DOM 節點 DOM NodeList DOM NamedNodeMap DOM Document DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM Parser XSLT 元素 XSLT/XPath 函式

XSLT <xsl:output>


❮ Complete XSLT Element Reference

定義和用法

The <xsl:output> element defines the format of the output document. (<xsl:output> 元素定義輸出文件的格式。)

Note: <xsl:output> is a top-level element, and must appear as a child node of <xsl:stylesheet> or <xsl:transform>. (注意: <xsl:output> 是一個頂層元素,必須作為 <xsl:stylesheet> 或 <xsl:transform> 的子節點出現。)


語法

<xsl:output
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"/>

屬性

Attribute 描述
method xml
html
text
name
Optional. Defines the output format. The default is XML (but if the first child of the root node is <html> and there are no preceding text nodes, then the default is HTML) (可選。定義輸出格式。預設為 XML(但如果根節點的第一個子節點是 <html> 且前面沒有文字節點,則預設為 HTML))

Netscape 6 only supports "html" and "xml" (Netscape 6 只支援“html”和“xml”)

version string Optional. Sets the W3C version number for the output format (only used with method="html" or method="xml") (可選。為輸出格式設定 W3C 版本號(僅在 method="html" 或 method="xml" 時使用))
encoding string Optional. Sets the value of the encoding attribute in the output (可選。設定輸出中 encoding 屬性的值)
omit-xml-declaration
no
Optional. "yes" specifies that the XML declaration (<?xml...?>) should be omitted in the output. "no" specifies that the XML declaration should be included in the output. The default is "no" (可選。“yes”指定在輸出中省略 XML 宣告 (<?xml...?>)。“no”指定在輸出中包含 XML 宣告。預設為“no”)
standalone
no
Optional. "yes" specifies that a standalone declaration should occur in the output. "no" specifies that a standalone declaration should not occur in the output. The default is "no" (可選。“yes”指定在輸出中應出現 standalone 宣告。“no”指定在輸出中不應出現 standalone 宣告。預設為“no”)

This attribute is not supported by Netscape 6 (Netscape 6 不支援此屬性)

doctype-public string Optional. Sets the value of the PUBLIC attribute of the DOCTYPE declaration in the output (可選。設定輸出中 DOCTYPE 宣告的 PUBLIC 屬性的值)
doctype-system string Optional. Sets the value of the SYSTEM attribute of the DOCTYPE declaration in the output (可選。設定輸出中 DOCTYPE 宣告的 SYSTEM 屬性的值)
cdata-section-elements namelist Optional. A white-space separated list of elements whose text contents should be written as CDATA sections (可選。一個以空格分隔的元素列表,其文字內容應寫為 CDATA 部分)
indent
no
Optional. "yes" indicates that the output should be indented according to its hierarchic structure. "no" indicates that the output should not be indented according to its hierarchic structure. (可選。“yes”表示輸出應根據其層次結構進行縮排。“no”表示輸出不應根據其層次結構進行縮排。)

This attribute is not supported by Netscape 6 (Netscape 6 不支援此屬性)

media-type string Optional. Defines the MIME type of the output. The default is "text/xml" (可選。定義輸出的 MIME 型別。預設為“text/xml”)

This attribute is not supported by Netscape 6 (Netscape 6 不支援此屬性)

示例 1

The output in this example will be an XML document, version 1.0. The character encoding is set to "UTF-8" and the output will be indented for readability (此示例中的輸出將是一個 XML 文件,版本為 1.0。字元編碼設定為“UTF-8”,輸出將縮排以便於閱讀。)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>

...

...

</xsl:stylesheet>

示例 2

The output in this example will be an HTML document, version 4.0. The character encoding is set to "UTF-8" and the output will be indented for readability (此示例中的輸出將是一個 HTML 文件,版本為 4.0。字元編碼設定為“UTF-8”,輸出將縮排以便於閱讀。)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" version="4.0"
encoding="UTF-8" indent="yes"/>

...

...

</xsl:stylesheet>

❮ Complete XSLT Element Reference
×

聯絡銷售

如果您想將 W3Schools 服務用於教育機構、團隊或企業,請傳送電子郵件給我們
sales@w3schools.com

報告錯誤

如果您想報告錯誤,或想提出建議,請傳送電子郵件給我們
help@w3schools.com

W3Schools 經過最佳化,旨在方便學習和培訓。示例可能經過簡化,以提高閱讀和學習體驗。教程、參考資料和示例會不斷審查,以避免錯誤,但我們無法保證所有內容的完全正確性。使用 W3Schools 即表示您已閱讀並接受我們的使用條款Cookie 和隱私政策

版權所有 1999-2024 Refsnes Data。保留所有權利。W3Schools 由 W3.CSS 提供支援