ENCODING attribute
Returns the name of the character encoding used to encode the contents of an XML document. The default encoding is UTF-8.
Data type: CHARACTER
Access: Readable/Writable
Applies to: X-document object handle, SAX-writer object handle
For an X-document object, the AVM sets the ENCODING attribute to the encoding name specified in the XML document’s encoding declaration when you load an XML document using the LOAD( ) method (Handle).
You can also set the ENCODING attribute to the name of the character encoding to use when saving an XML document using the SAVE( ) method. The AVM records this character encoding in the encoding declaration in the XML document’s prologue. If you do not set the ENCODING attribute, when you save the document, the document will not have an encoding declaration in its prologue, but the document will be saved with the default encoding of UTF-8.
For a SAX-writer object, you can set the ENCODING attribute to the name of the character encoding to use when writing the XML document. You can set this attribute only when the WRITE-STATUS is either SAX-WRITE-IDLE or SAX-WRITE-COMPLETE. That is, you can only change this attribute when the writer is not writing, otherwise it fails and generates an error message. The AVM records this character encoding in the encoding declaration in the XML document’s prologue. If you do not set the ENCODING attribute, when you write the document, the document will not have an encoding declaration in its prologue, but the document will be written with the default encoding of UTF-8.
The encoding name must be an Internet Assigned Numbers Authority (IANA) name supported by the ABL XML Parser. Table 78 lists the names of the supported IANA encodings and their corresponding ABL code pages.
OpenEdge Release 10.2B
|