"converting json to xml" Code Answer

5

despite the fact your json provided in the question is not complete, you have multiple properties at the top level as indicated by the exception. you have to define the root for it to get valid xml:

var doc = jsonconvert.deserializexmlnode(jsonoutput, "root");

edit: in order to print out your xml with indentation you can use xdocument class from system.xml.linq namespace: xdocument.parse(doc.innerxml).

By jjbravo on October 14 2022

Answers related to “converting json to xml”

Only authorized users can answer the Search term. Please sign in first, or register a free account.