<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. Integrate SharePoint 2013 with Team Foundation Server 2012

    Now that SharePoint 2013 is out I want to make sure that I can integrate SharePoint 2013 with Team F ...

  2. zookeeper选举机制

    在上一篇文章中我们大致浏览了zookeeper的启动过程,并且提到在Zookeeper的启动过程中leader选举是非常重要而且最复杂的一个环节.那么什么是leader选举呢?zookeeper为什么 ...

  3. 数据库连接池中是将connection放进threadlocal里的

    我有几点不太明白的,望各位大侠指教下.1.j2ee的应用中,有一个用户请求就会启动一个线程.而如果我们把connection放在Threadlocal里的话,那么我们的程序只需要一个connectio ...

  4. C# 如何做类似微博和QQ的授权登录

    记录下吧,dotnet下有这个http://dotnetopenauth.net/开源的框架可以用来实现服务端和客户端的实现,具体的使用方法还真研究,第一次接触OAuth这个概念

  5. Setup SS5 Socks Proxy

    Install and configure ss5 socks proxy with simple authentication SS5 is a high performance socks pro ...

  6. Unity接入谷歌支付

    文章理由 前段时间负责Unity接入Google内购功能,一开始研究别人的技术博客时发现,他们的文章都有些年头了,有些细节的地方已经不像n年前那样了,技术永远是需要更新的,而这篇就作为2016年末的最 ...

  7. Ruby:字符集和编码学习总结

    背景 Ruby直到1.9版本才很好的支持了多字节编码,本文简单总结了今天学习的关于Ruby编码方面的知识. 字符串可以使用不同的编码 在.NET中字符串的编码是一致的,Ruby允许字符串有不同的编码, ...

  8. Gradle Android最新自动化编译脚本教程

    转自:http://blog.csdn.net/changemyself/article/details/39927381 一.前言 Gradle 是以 Groovy 语言为基础,面向Java应用为主 ...

  9. ASP.NET 5 Beta6发布了(翻译)

    感觉就好像我们刚刚发布了一个版本,现在我们又要发布一个新的版本.开发团队通过努力工作在Visual Studio2015的正式版上提交使用ASP.NET 5开发工具的上的更新以及库的更新.新的版本为b ...

  10. HDFS命令行工具

    1. hadoop fs 帮助信息 hadoop fs 使用help选项可以获得某个具体命令的详细说明: hadoop fs -help ls 2. 列出HDFS文件和目录 hadoop fs -ls ...