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;
}
No comments:
Post a Comment