9
這更多是我想做的整體變化,我想知道如何使用UTF-8大寫而不是utf-8小寫生成xml文件?utf-8用大寫?
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
settings.Indent = true;
settings.IndentChars = "\t";
XmlWriter writeXML = XmlWriter.Create("test_file.xml", settings);
writeXML.WriteStartDocument(false);
writeXML.WriteComment(fileLicense);
writeXML.WriteStartElement("templates");
writeXML.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance");
writeXML.WriteAttributeString("xsi", "noNamespaceSchemaLocation", null, "test_file.xsd");
writeXML.WriteEndElement();
writeXML.WriteEndDocument();
writeXML.Close();
很好,謝謝。 – Prix 2010-11-27 13:24:48