zoukankan      html  css  js  c++  java
  • 解析XML文件

    获取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 + "']");
    XmlNode SymbologyNode = NameNode.SelectSingleNode("//layer[@name='" + layerName + "']//Symbology[@FieldValue='" + strieldValue + "']");
  • 相关阅读:
    hdu 5171(矩阵快速幂,递推)
    hdu 1316(大整数)
    hdu 5170(数学)
    hdu 5167(dfs)
    hdu 5166(水题)
    hdu 5720(贪心+区间合并)
    BestCoder 2nd Anniversary的前两题
    hdu 3065(AC自动机)
    2.3绘制构造线与射线
    查找ARP攻击源
  • 原文地址:https://www.cnblogs.com/leebokeyuan/p/5534352.html
Copyright © 2011-2022 走看看