Convert XML Elements values from Hex
I have an xml document that contains the hex representation of ascii characters. I want to convert the values to their readable text values and resave the file.
The file can contain a large number of entries.
I have searched the net and these forums for a way to accomplish this.
Any assistance is appreciated.
Thanks!
Document Example below:
____________________
<?xml version="1.0"?>
<message>
<!-- message 1 -->
<CONTEXT_11>
<CONTEXT_0>4855534D303130333238</CONTEXT_0>
<CONTEXT_1>53</CONTEXT_1>
<CONTEXT_2>3230303631313032323135333433</CONTEXT_2>
</CONTEXT_11>
</message>
_____________________
[777 byte] By [
togesu] at [2007-11-11 10:02:14]

# 1 Re: Convert XML Elements values from Hex
You need to split up the hex string into each seperate part. So you have an array of hex values instead of one long string containg multiples...
For each hex value do:
Convert.ToInt32(hexValue[i],16);
then:
Convert.ToChar(intValue);
and then concatonate the string...