using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.Collections;
/// <summary>
/// XMLReading 的摘要说明
/// </summary>
public class XMLReading
{
private XmlDocument xmlDoc;
//load xml file
private void LoadXml()
{
xmlDoc = new XmlDocument();
xmlDoc.Load(HttpContext.Current.Server.MapPath("~/bestgomanager/baseconfig.xml"));
}
//修改节点
public void UpdateElement(string webName, string wareCache, string newsCache, string imageSize, string forbidWords)
{
LoadXml();
//这个方法太复杂
//XmlNodeList nodeList = xmlDoc.SelectSingleNode("webcfg").ChildNodes;//获取bookstore节点的所有子节点
//foreach (XmlNode xn in nodeList)//遍历所有子节点
//{
// XmlElement xe = (XmlElement)xn;//将子节点类型转换为XmlElement类型
// if (xe.GetAttribute("name") == "基本配置")//如果name属性值为“基本配置”
// {
// //xe.SetAttribute("name", "基本配置");
// //如果下面有子节点在下走<