XML DOM xmlEncodingプロパティ


Document 对象参考手册Document オブジェクト

定義と用法

xmlEncoding プロパティは、ドキュメントのエンコーディングを返します。

構文

documentObject.xmlEncoding


例

以下のコードスニペットはloadXMLDoc()「」を xmlDoc に読み込み、XML エンコーディング、standalone プロパティ、ドキュメントの XML バージョンを表示します:

例

xmlDoc=loadXMLDoc("books.xml"); document.write("XML encoding: " + xmlDoc.xmlEncoding); document.write("<br>"); document.write("XML standalone: " + xmlDoc.xmlStandalone); document.write("<br>"); document.write("XML version: " + xmlDoc.xmlVersion); document.write("<br>"); document.write("Encoding used when parsing: " + xmlDoc.inputEncoding);

出力:

XML encoding: UTF-8
XML standalone: false
XML version: 1.0
Encoding used when parsing: UTF-8

試してみる »

Document 对象参考手册Document オブジェクト その他の拡張