如何遍历xmlDocument中流的内容
譬如
我要找每个节点中<aaa>的innerText

解决方案 »

  1.   


        using System.Xml;    public IList GetCollection()
        {
            ArrayList aaaCollection = new ArrayList();
            XmlDocument doc = new XmlDocument();
            doc.Load("xml文件路径");
            XmlNodeList nodeList = doc.GetElementsByTagName("aaa"); //获取aaa节点集合
            foreach (XmlNode node in nodeList)
            {
                aaaCollection.Add(node.InnerText);
            }
            return aaaCollection;
        }