According to Microsoft's instructions, the XML string retrieved from the Microsoft. xmldom XML Attribute does not have the encoding attribute, and only the Save method has it. Refer to Microsoft's msdn description:
Http://msdn.microsoft.com/en-us/library/ms755989 (V = vs.85). aspx
The property is read-only.
TheXMLProperty always returns a unicode string. That is,
XMLPropertyDomdocumentConverts the document from its original encoding to Unicode. As a result, the original encoding attribute is removed. For example,
<? XML version = "1.0" encoding = "UTF-8"?>Appears in
XMLProperty as follows.
Other
<? XML version = "1.0"?>
If the original encoding was not removed byXMLProperty, the following line returns an error indicating the parser cannot switch from Unicode to UTF-8 encoding.
Other
Xmldoc. loadxml (xmldoc. XML );
If you useSaveMethod, the original encoding is preserved. For example, if you load a document in Microsoft Windows 1252 encoding, it will be saved in that format.
This value depends on the value ofNodetypeProperty.