// using System.Xml; String rawXml = @"<root> <person firstname=""Riley"" lastname=" ... ... <看更多>
Search
Search
// using System.Xml; String rawXml = @"<root> <person firstname=""Riley"" lastname=" ... ... <看更多>
static string PrettyXml(string xml). {. var stringBuilder = new StringBuilder();. var element = XElement.Parse(xml);. var settings = new XmlWriterSettings ... ... <看更多>
Don't parse it through string manipulation, use the XML libraries in the framework. I'd recommend LINQ to XML. Parse it and make your changes. ... <看更多>
Here's a couple of simple classes. XStream can convert instances of these to XML and back again. public class Person { private String firstname; private String ... ... <看更多>