there is a xml message:
<Data>
<aa>12345\n67890</aa>
<bb>98765\\4321<bb>
<Data>
I need to convert the xml to json:
String strXmlData = xmlHelper.SelectSingleNode(xml,"//Data").OuterXML
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(strJsonData);
String jsonData = JsonConvert.SerializeXmlNode(xmlDoc, Newtonsoft.Json.Formatting.None)
The it seems that json result is added escape charactor by JsonConvert automatically.
{"aa":"12345\\n67890","bb":"98765\\\\4321"}
I need to keep the value as it is(ie, \n as new line instead of "\n" string). Is there any way to prevent JsonConvert to generate escape charactor? Or is there any suggestion to remove the escape charactor?
Any Suggestion is appreciated, thank you!