CURRENT PROJECTS
loading
<>114848000000</><amount>0.00</amount><avs_addr>""YARR</avs_addr>to
{"amount":"0.00","avs_addr":"\"YARR"}.. while stripping out the completely invalid <> node. This will also consider all node values to be a string.
// csc /r:LitJson.dll xmlToJsonToObject.cs namespace com.overset { using LitJson; using System.Text.RegularExpressions; public class CSMadness { public JsonData xmlToJsonToObject () { string rStr = @"<>114848000000</><amount>0.00</amount><avs_addr>""YARR</avs_addr>"; string rStr = Regex.Replace(Regex.Replace(Regex.Replace(responseData, @"\\", @"\\"), @"""", @"\"""), @"<>[^<]*</>", @""); rStr = "{" + Regex.Replace(rStr, @"<([^>]*)>([^<]*)<\/[^>]*>", @",""$1"":""$2""").Substring(1) + "}"; return JsonMapper.ToObject( rStr ); } } }