zoukankan      html  css  js  c++  java
  • 解析带命名空间的xml文件

    void Doc()
    {
    XmlDocument doc = new XmlDocument();
    doc.Load(AppDomain.CurrentDomain.BaseDirectory + "File.xml");
    XmlNode node = doc.DocumentElement;

    //加入命名空间
    NameTable nt = new NameTable();
    XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
    nsmgr.AddNamespace("cim", "http://ns.zhaopin.com/resumes");

    XmlNodeList xnl = node.SelectSingleNode("//cim:Resume", nsmgr).ChildNodes;
    StringBuilder sb = new StringBuilder();
    int i = 0;
    foreach (XmlNode item inxnl)
    <?xml version="1.0" encoding="utf-8"?>
    <cim:Resume xmlns:cim="http://ns.zhaopin.com/resumes" xmlns:rdf="a">
    <cim:Breaker rdf:ID="_Breaker_abc5011" >
    <cim:Naming.aliasName>abc5011</cim:Naming.aliasName>
    <cim:Naming.name>abc5011</cim:Naming.name>
    <cim:Switch.normalOpen>1</cim:Switch.normalOpen>
    <cim:Breaker.ampRating>0.0000</cim:Breaker.ampRating>
    <cim:Equipment.MemberOf_EquipmentContainer rdf:resource="#_VoltageLevel_abc500"/>
    <cim:ConductingEquipment.Terminals rdf:resource="#_Terminal_cb1_T1"/>
    <cim:ConductingEquipment.Terminals rdf:resource="#_Terminal_cb1_T2"/>
    </cim:Breaker>
    <cim:BusbarSection rdf:ID="_BusbarSection_abc5b1">
    <cim:Naming.aliasName>二电厂1母</cim:Naming.aliasName>
    <cim:Naming.name>abc5b1</cim:Naming.name>
    <cim:Equipment.MemberOf_EquipmentContainer rdf:resource="#_VoltageLevel_abc500"/>
    <cim:ConductingEquipment.Terminals rdf:resource="#_Terminal_bus1_T1"/>
    </cim:BusbarSection>
    </cim:Resume>


  • 相关阅读:
    webpack 打包优化
    webpack 打包
    webpack 删除未使用函数
    Remote Address
    https://my.vmware.com/cn/group/vmware/evalcenter?p=vsphere-eval-7#tab_download
    python 代码检测
    windows 同时安装python2和python3并配置虚拟环境
    electron-log 修改日志保存路径
    png转ico源码
    Electron 开发点滴记录
  • 原文地址:https://www.cnblogs.com/cyccess/p/2341518.html
Copyright © 2011-2022 走看看