This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

xmlEncoding

Summary

Gets a value that represents the character encoding that is specified in the declaration of an XML document.

Property of dom/Documentdom/Document

Syntax

Note: This property is read-only.

var encoding = document.xmlEncoding;

Return Value

Returns an object of type StringString

The encoding name that is specified in the declaration of an XML document.

Examples

The following code example shows an XML declaration that specifies character encoding.

<?xml encoding="UTF-8"?>

Related specifications

DOM Level 3 Core
Recommendation

Attributions