C#操作xml文件入门(3) {XmlElement xe=(XmlElement)xnf;Console.WriteLine(xe.GetAttribute("genre"));//显示属性值Console.WriteLine(xe.GetAttribute("ISBN"));
XmlNodeList xnf1=xe.ChildNodes;foreach(XmlNode xn2 in xnf1){Console.WriteLine(xn2.InnerText);//显示子节点点文本}}