标签:des blog http io ar os on div log
原文:字符串json转换为xml xml转换json// To convert an XML node contained in string xml into a JSON string XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); string jsonText = JsonConvert.SerializeXmlNode(doc); // To convert JSON text contained in string json into an XML node XmlDocument doc = (XmlDocument)JsonConvert.DeserializeXmlNode(json);
XmlNote myXmlNode = JsonConvert.DeserializeXmlNode(myJsonString);
// or .DeserilizeXmlNode(myJsonString, "root");
// if myJsonString does not have a root
string jsonString = JsonConvert.SerializeXmlNode(myXmlNode);
XmlDictionaryReader reader = JsonReaderWriterFactory.CreateJsonReader(Encoding.UTF8.GetBytes(xml), XmlDictionaryReaderQuotas.Max); XmlDocument xdoc = new XmlDocument(); xdoc.Load(reader);
标签:des blog http io ar os on div log
原文地址:http://www.cnblogs.com/lonelyxmas/p/4107661.html