110,571
社区成员
发帖
与我相关
我的任务
分享
int i=1;
XmlDocument xml = new XmlDocument();
xml.Load(@"E:\a.xml");
XmlNodeList node = xml.SelectNodes("/structure/Product");
foreach (XmlNode n in node)
{
XmlDocument x = new XmlDocument();
XmlDeclaration dec = x.CreateXmlDeclaration("1.0", "utf-8", null);
x.AppendChild(dec);
XmlNode Product = x.ImportNode(n, true);
x.AppendChild(Product);
x.Save(@"E:\" + i + ".xml");
i++;
}