SetXMLDeclaration

Description

Sets the declaration of the XML document.

Syntax

pbdom_document_name.SetXMLDeclaration (string version, string encoding, string standalone)

Argument

Description

pbdom_document_name

The name of a PBDOM_DOCUMENT object.

version

The version number of the current XML document to be declared.

encoding

The encoding of the current XML document to be declared, such as "UTF-8", or "UTF-16LE".

standalone

A string specifying whether the document is standalone.


Return value

Boolean.

Usage

Only version 1.0 and 1.1 are valid now, so the value can be "1.0", "1.1", " " or null.

The value of standalone can be "yes", "no", " " or null.

The value of encoding can be " ", null, or any of the followings:

XERCES-XMLCH

US-ASCII

USASCII

ASCII

US_ASCII

UTF-8

UTF8

ISO8859-1

ISO-8859-1

ISO_8859-1

IBM-819

IBM819

LATIN1

LATIN-1

LATIN_1

UTF-16 (LE)

UTF-16LE

UCS-4 (LE)

UCS-4LE

UTF-16 (BE)

UTF-16BE

UCS-4(BE)

UCS-4BE

EBCDIC-CP-US

IBM037

IBM1140

WINDOWS-1252

If all three arguments (version, encoding, and standalone) are set to " " or null, the declaration of the XML document will be removed.

If either encoding or standalone is not " " or null, the value of version must be valid, otherwise an exception will be thrown.

If version is valid, setting encoding or standalone to " " or null will not modify the argument. This function does not check whether the value of encoding is correct; it always returns success.

See also

GetXMLDeclaration