标签:
获取XML文件
private XmlDocument GetDoc(string strpath) { if (System.IO.File.Exists(strpath) == true) { XmlDocument document = new XmlDocument(); document.Load(strpath);//加载xml文档 return document; } else { return null; } }
解析XML
XmlNode newNode = document.DocumentElement.SelectSingleNode("//layer[@name=‘" + 名称+ "‘]"); if (newNode != null) { string aliasName = newNode.Attributes["别名"].Value.ToString();
string strDes = newNode.Attributes["描述"].Value.ToString(); }
XmlNode SymbologyNode = NameNode.SelectSingleNode("//Symbology[@FieldValue=‘" + strieldValue + "‘]");
标签:
原文地址:http://www.cnblogs.com/lee24789229/p/5534352.html