Showing posts with label XML to JSON. Show all posts
Showing posts with label XML to JSON. Show all posts

Saturday, November 18, 2017

Get JSON string from XML

Here is the function to convert XML string to JSON string.

string GetJSONStringFromXML(string inXMLString){
XDocument xDoc = XDocument.Parse(inXMLString); //orXDocument.Load(xmlfilepath)
string jsonString = JsonConvert.SerializeXNode(xDoc);
return jsonString;
}

All Blogs so far ...