Today I had faced an error while converting JSON string into an XML document object using JSON.net Jsonconvert.
Here is the code snippet
FacebookClient fbclient = new FacebookClient();
JObject objFeeb = JObject.Parse(@" " + fbclient.Get("me/feed") + " ");
XmlDocument doc = JsonConvert.DeserializeXmlNode(objFeeb.ToString());
When I run the above code I was getting an error as "This document already has a ' DocumentElement ' node"
To fix the issue, I just have defined the root element of XML doc and it worked !!
Here is the working code.
XmlDocument doc = JsonConvert.DeserializeXmlNode(objFeeb.ToString(), "FacebookFeed");
Thanks! This helped me
ReplyDeleteNor ought to you rule out special company rates if your volumes are excessive.can you fax documents online
ReplyDelete