Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM inputEncoding Property

XML DOM inputEncoding Property


Document Object Reference Document Object


Definition and Usage

The inputEncoding property returns the encoding used for the document (at parse time).

Syntax

documentObject.inputEncoding


Example

The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and display the XML encoding, the standalone property, and the XML version of the document:

Example

xmlDoc

=

loadXMLDoc

(

"

books.xml

"

)

;

document

.

write

(

"

XML encoding:

"

xmlDoc

.

xmlEncoding

)

;

document

.

write

(

"


"

)

;

document

.

write

(

"

XML standalone:

"

xmlDoc

.

xmlStandalone

)

;

document

.

write

(

"


"

)

;

document

.

write

(

"

XML version:

"

xmlDoc

.

xmlVersion

)

;

document

.

write

(

"


"

)

;

document

.

write

(

"

Encoding used when parsing:

"

xmlDoc

.

inputEncoding

)

;

Output:

XML encoding: UTF-8

XML standalone: false

XML version: 1.0

Encoding used when parsing: UTF-8

Try it »


Document Object Reference Document Object