By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 2,007 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

How to select specific nodes from bulky xml and convert it into json?

P: 1
I have XML file with large amount of data now I need to select specific nodes from that XML and convert it into JSON
4 Weeks Ago #1
Share this Question
Share on Google+
1 Reply

P: 22
hello try this for json to xml and xml to json

Expand|Select|Wrap|Line Numbers
  1. XmlDocument doc = new XmlDocument();
  2. doc.LoadXml(xml);
  3. // To convert an XML node  into string json 
  4. string jsonText = JsonConvert.SerializeXmlNode(doc);
  6. // To convert JSON text contained in string json into an XML node
  7. XmlDocument doc = JsonConvert.DeserializeXmlNode(json);
2 Weeks Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.