<EssentialFunctions>
     <Qualification description="We Offer" source="AdDesc1">LOCAL, NON-EXPATRIATE PAY + BENEFITS + ANNUAL LEAVE EMPLOYEE STATUS:REGULAR VISA:SPONSORED*, OVERSEAS CANDIDATES ELIGIBLE TO APPLY AIRFARE:NOT SPONSORED HOUSING:NOT SPONSORED MEDICAL INSURANCE:INCLUDED</Qualification>
     <Qualification description="Roles and Responsibilities" source="AdDesc2">1、 Service business delivery process design and realization 2、 Business process optimization 3、 Document management 4、 External communications</Qualification>
     <Qualification description="Requirements" source="AdDesc3">Minimum requirements: 1. Bachelor’s degree or above with a related major (IT Management, Business Administration , technology etc.) </Qualification>
     <Qualification description="Additional Information" source="AdDesc4">The ultimate interpretation rights of all above belongs to Legend Group HR headquarters. In case there are inconsistencies between the English and the Chinese version, the Chinese language version applies.</Qualification>
     <Qualification source="Language">EN</Qualification>
     <Qualification source="LOV5305" category="Function Area">客户服务</Qualification>
     <Qualification source="LOV5510" category="Location">北京市</Qualification>
</EssentialFunctions>

在C#中如何循环读取属性及内容?
通过node.Attributes["属性名"].Value获取属性值
当作普通节点对待,遍历节点来获取所有节点值.

StringBuilder sb = new StringBuilder();

XmlNode ndQualification = el.SelectSingleNode("JobPositionInformation/JobPositionDescription/EssentialFunctions");
string _attr_source = "";
string _attr_desc = "";
string _attr_category = "";
foreach (XmlNode node in ndQualification.ChildNodes)
{                
      if (!XmlUtility.IsEmpty(node))
      {
             if(node.Attributes["source"] != null)
                   _attr_source = (String.IsNullOrEmpty(node.Attributes["source"].Value))?"":node.Attributes["source"].Value;
             if(node.Attributes["description"] != null)
                  _attr_desc = (String.IsNullOrEmpty(node.Attributes["description"].Value))?"":node.Attributes["description"].Value;
             if(node.Attributes["category"] != null)
                   _attr_category = (String.IsNullOrEmpty(node.Attributes["category"].Value))?"":node.Attributes["category"].Value;
             if(_attr_source.Length > 0)
                  sb.Append(string.Format(" <b>source:</b>{0};", _attr_source));
             if(_attr_desc.Length > 0)
                   sb.Append(string.Format(" <b>description:</b>{0};", _attr_desc));
             if(_attr_category.Length > 0)
                   sb.Append(string.Format(" <b>category:</b>{0};", _attr_category));
             sb.Append("<br>");
             sb.Append(node.InnerText.Trim()); //节点值
             sb.Append("<br><br>");

_attr_source = "";
             _attr_desc = "";
             _attr_category = "";
        }
}
         
 return sb.ToString();

XML文件标签名一致,而属性值不同,如何遍历取值写法 摘录的更多相关文章

  1. Java jdom解析xml文件带冒号的属性

    Java jdom解析xml文件带冒号的属性 转载请标明出处: https://dujinyang.blog.csdn.net/article/details/99644824 本文出自:[奥特曼超人 ...

  2. js动态添加-表格逐行添加、删除、遍历取值

    关于js对表格进行逐行添加,今天抽空整理了一下:新建一个html文件(没有编辑器的可以新建一个demo.txt文件,然后改后缀名为demo.html),把下面代码全部贴进去即可.功能包括:表格添加一行 ...

  3. Map 遍历取值及jstl的取值

    Map 遍历取值及jstl的取值 学习了:http://blog.csdn.net/yanjiaye520/article/details/17354239 1.Java map的便利取值 Java代 ...

  4. Oracle存储过程-自定义数据类型,集合,遍历取值

    摘要 Oracle存储过程,自定义数据类型,集合,遍历取值 目录[-] 0.前言 1.Packages 2.Packages bodies 3.输出结果 0.前言 在Oracle的存储过程中,可能会遇 ...

  5. jQuery循环遍历取值

    1:循环遍历取值 var arr = new Array(); $(".plus-tag a span").each(function(i) { arr[i] = $(this). ...

  6. set类型没有单独取值功能 通过循环取值

    set类型没有单独取值功能 通过循环取值

  7. Python 字符串——巧取值和列表——巧取值 对比

    Python 字符串——巧取值和列表——巧取值 对比 1.字符串取值实例: samp_string = "Whatever you are, be a good one." for ...

  8. properties文件属性值通过xml文件为 java entity属性赋值

    一.通过xml配置文件进行赋值: 举个栗子,一目了然: 1.1 properties文件: 1.2 xml配置文件,将properties属性与java entity属性相关联:(这是一个新建的xml ...

  9. testng.xml文件结构组成及节点属性说明

    TestNG的DTD检查文件:http://testng.org/testng-1.0.dtd.PHP 更多testng配置及说明,请移步http://testdoc.org/docmaster?pi ...

随机推荐

  1. ubuntn 内核升级到LINUX v4.11.8:

    升级到LINUX v4.11.8: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.8/linux-headers-4.11.8-041108_ ...

  2. ubuntu14.04 内核升级到 linux kernel 4.9

    http://blog.csdn.net/liuruiqun/article/details/55097292

  3. linux下使用free命令查看实际内存占用(可用内存)

    转:http://blog.is36.com/linux_free_command_for_memory/ linux下在终端环境下可以使用free命令看到系统实际使用内存的情况,一般用free -m ...

  4. Linux 系统 /proc/[pid]/stat 文件解释

    转载:http://www.net527.cn/a/caozuoxitong/Linux/2012/0823/24385.html [root@localhost ~]# cat /proc/6873 ...

  5. linux ifconfig

    Linux and Unix ifconfig command Quick links About ifconfig Syntax Examples Related commands Linux an ...

  6. <三>年编程经验、何去何从?

    SharePoint开发经验3年+,基本的SharePoint模板开发都胜任: Asp.net基础一般,Html.Css.JavaScript.JQuery.Ajax.Sql.服务器等也都有所涉猎,对 ...

  7. [Gradle] Gradle 简介

    Gradle 是以 Groovy 语言为基础,面向Java应用为主.基于DSL(领域特定语言)语法的自动化构建工具. Ø gradle对多工程的构建支持很出色,工程依赖是gradle的第一公民. Ø ...

  8. Power Desginer系列02【转载】

    在概念模型中主要有以下几个操作和设置的对象:实体(Entity).实体属性 (Attribute).实体标识(Identifiers).关系(Relationship).继承(Inheritance) ...

  9. 设置 IE 默认模式为 IE8

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

  10. SSIS实践入门2:批量包的调度和SQLServer代理作业配置

    趁着上一篇文章的余温,我们继续研究一下SSIS中多个包如何调度,难道需要一个包一个包的配置调度程序吗?显然不是的,接下来我们就说一说在SSIS应用中如何批量的调度所有的作业,本文只讲述一个基本的逻辑过 ...