Thursday, February 22, 2018

Convert XML to JSON!

Stack Overflow suggests:

XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
string jsonText = JsonConvert.SerializeXmlNode(doc);
XmlDocument doc = JsonConvert.DeserializeXmlNode(json);

 
 

...as a way to make the swap in C# though I have not tried it myself. A simple online converter may be found here.

No comments:

Post a Comment