XML : JSON to XML Conversion with weird names

I am trying to convert a given JSON to XML using the following code:

XmlDocument doc = new XmlDocument(); doc = JsonConvert.DeserializeXmlNode(text);

I am reading the json from a file using System.IO.File.ReadAllText. My json is somewhat of this format:

  {    "rs0:ReadMessage": {      "-xmlns": "http://xmlns.jsonfile.com/2015/08/Document/File/SubFile/v1.0",      "-xmlns:rs0": "http://www.jsonfile.com/doc/SubFile/Details/v1",          "rs0:MessageStart": {            "rs0:Message": {              "Emp_NUM": "316789",              "Emp_NM": "Rick Samuel",              "Emp_DES": "Fresher",              "Dept_Type_NM": "IT"              }          }      }  }    

But the tags are getting generated as < MessageStart > instead of < rs0:MessageStart >. Any suggestions?

No comments:

Post a Comment