xml文件如下:
代码如下:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Normalize();
xmlDoc.Load(Server.MapPath(@"test.xml"));
XmlNodeList nodes = xmlDoc.SelectNodes("root//sector");
foreach (XmlNode node in nodes)
{
node.Attributes["pic"].Value = "images//aaBig.jpg";
node.Attributes["url"].Value = "aaaBig.aspx";
}
xmlDoc.Save("test.xml");