codequest
asked on
Change XMLDocument Encoding
I've loaded the xml below into an XMLDocument (call it XmlDoc).
Is there a way to programmatically change the encoding attribute value to "utf-8" (or whatever),
OTHER than doing a string replace on the innerText of the XMLDocumentDeclaration?
'========================= ========== ========
<?xml version="1.0" encoding="utf-16" ?>
<Control>
<Value1>
<SubVal1A>Units</SubVal1A>
<SubVal1B>Type</SubVal1B>
</Value1>
<Value2>
<SubVal2A>Over</SubVal2A>
<SubVal2B>Load</SubVal2B>
</Value2>
</Control>
Is there a way to programmatically change the encoding attribute value to "utf-8" (or whatever),
OTHER than doing a string replace on the innerText of the XMLDocumentDeclaration?
'=========================
<?xml version="1.0" encoding="utf-16" ?>
<Control>
<Value1>
<SubVal1A>Units</SubVal1A>
<SubVal1B>Type</SubVal1B>
</Value1>
<Value2>
<SubVal2A>Over</SubVal2A>
<SubVal2B>Load</SubVal2B>
</Value2>
</Control>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.