Return the root element instead of document node

This commit is contained in:
Chriztian Steinmeier
2013-11-20 14:19:39 +01:00
parent 2cb4b207dc
commit 90c4358844

View File

@@ -251,13 +251,13 @@ namespace umbraco
json = "{\"arrayitem\":" + json + "}";
}
var xml = JsonConvert.DeserializeXmlNode(json, "json", false);
return xml.CreateNavigator().Select("/");
return xml.CreateNavigator().Select("/json");
}
catch (Exception ex)
{
var xd = new XmlDocument();
xd.LoadXml(string.Format("<error>Could not convert json to xml. Error: {0}</error>", ex));
return xd.CreateNavigator().Select("/");
return xd.CreateNavigator().Select("/error");
}
}