标签:-- doc builder schema replace tostring div uil string
public static XmlDocument JsonToXml(OrderDetail orderDetail) { XmlDocument document = new XmlDocument(); StringBuilder sb = new StringBuilder(); using (TextWriter tw = new StringWriter(sb)) { var xmlS = new XmlSerializer(typeof(OrderDetail)); xmlS.Serialize(tw, orderDetail); string serialized = sb.ToString(); serialized = serialized.Replace(@"xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""", ""); serialized = serialized.Replace(@"xmlns:xsd=""http://www.w3.org/2001/XMLSchema""", ""); document.LoadXml(serialized); } return document; }
标签:-- doc builder schema replace tostring div uil string
原文地址:https://www.cnblogs.com/BounceGuo/p/10979618.html