XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlText); //plu.xml 编码是ANSI的。否则称上品名是乱码
XmlElement xeRoot = xmlDoc.DocumentElement;
XmlDeclaration xdl = xmlDoc.CreateXmlDeclaration("1.0", "gb2312", "yes");
xmlDoc.InsertBefore(xdl, xeRoot);
xmlDoc.Save(fileFullName);
相关文章
- 01-07把XML保存为ANSI编码