@NALB, Welcome to Microsoft Q&A, based on my test, I reproduced the same problem with you. The first error due to the url in the xml can not be identified. The second error means that we could not change the json name programmatically. I suggest that you could get the name first and replace the string in the end. Here is a code example you could refer to.
var json = File.ReadAllText("B:\\t.json");
var jsonReturn = JsonConvert.DeserializeObject<dynamic>(json);
string pagestr = string.Empty;
string str = "";
foreach (var item in jsonReturn.pages)
{
pagestr += item.Name;
str = Regex.Replace(item.Name, "://", "_");
str = Regex.Replace(str, ":", "_");
}
json=json.Replace(pagestr,str);
var data = "{\"Row\": " + json + "}";
XmlDocument doc = JsonConvert.DeserializeXmlNode(data.ToString(), "root");
Console.WriteLine( doc.InnerXml);
Tested result:
Hope my advice could help you. Best Regards, Jack
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.