xml learning (7) .net obtains the maximum value of xml node or attribute

黄舟
Release: 2017-02-23 14:40:26
Original
2047 people have browsed it

上一节中,我们介绍了一些xml的xpath属性和函数

下面我们来介绍两个比较特殊的使用:

1.获取相同节点的最大值

2.获取相同节点某属性最大值

xmlName为“内容”

1.获取相同节点的最大值


string fileName = HttpContext.Current.Request.PhysicalApplicationPath + "\\Xml\\" + xmlName + ".xml";//xml的物理路径 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode fdfdf = xmlDoc.SelectSingleNode("//rows[not(.
        
Copy after login

2.获取相同节点某属性最大值

string fileName = HttpContext.Current.Request.PhysicalApplicationPath + "\\Xml\\" + xmlName + ".xml";//xml的物理路径 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode maxNodejj = xmlDoc.SelectSingleNode("//rows/@ID[not(.
        
Copy after login


下面是内容.xml

  
2
4 9 8
Copy after login

以上就是xml学习(7) .net 获取xml节点或者属性最大值的内容,更多相关内容请关注PHP中文网(m.sbmmt.com)!




source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!