c# - How to convert JSON to XML or XML to JSON? -
I convert Jason into JSON format to convert a string to an object or voiceword. Started using the net. I'm not sure in the Json.NET framework, it is possible to convert the string from JSON into XML format and voice verses?
Yes Supporting methods for this exact purpose are included using the JsonConvert class:
// To convert XML node into a JSON string XmlDocument doc = new XmlDocument () string in xml; Doc.LoadXml (xml); String jsontext = JsonConvert.SerializeXmlNode (doctor); // XML node XmlDocument doc = JsonConvert.DeserializeXmlNode (json) to convert JSON text included in string JSN; Documentation here:
Comments
Post a Comment