Convert XML Elements values from Hex


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Convert XML Elements values from Hex

Hybrid View

  1. #1
    Join Date
    Nov 2006
    Posts
    4

    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>
    _____________________

  2. #2
    Join Date
    Jul 2006
    Posts
    14
    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:

    Code:
    Convert.ToInt32(hexValue[i],16);
    then:

    Code:
    Convert.ToChar(intValue);
    and then concatonate the string...

Similar Threads

  1. how to clone database using mysql
    By zarien in forum Database
    Replies: 1
    Last Post: 05-17-2006, 04:27 AM
  2. Try XML Junction
    By Tim in forum xml.announcements
    Replies: 0
    Last Post: 10-11-2001, 05:00 PM
  3. XML Startkabel Updates
    By xmlstartkabel in forum XML
    Replies: 0
    Last Post: 10-10-2001, 05:07 AM
  4. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 11:53 AM
  5. Check out Turbo XML: Free trial download
    By Extensibility in forum web.announcements
    Replies: 0
    Last Post: 07-20-2000, 07:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center