這篇文章給大家分享的是有關(guān).net怎樣獲取xml節(jié)點(diǎn)或者屬性大值的內(nèi)容。小編覺得挺實(shí)用的,因此分享給大家做個(gè)參考。一起跟隨小編過來看看吧。
1.獲取相同節(jié)點(diǎn)的大值
string fileName = HttpContext.Current.Request.PhysicalApplicationPath + "\\Xml\\" + xmlName + ".xml";//xml的物理路徑 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode fdfdf = xmlDoc.SelectSingleNode("http://rows[not(./rows)]");
2.獲取相同節(jié)點(diǎn)某屬性大值
string fileName = HttpContext.Current.Request.PhysicalApplicationPath + "\\Xml\\" + xmlName + ".xml";//xml的物理路徑 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); XmlNode maxNodejj = xmlDoc.SelectSingleNode("http://rows/@ID[not(./rows/@ID)]");
下面是內(nèi)容.xml
2 4 9 8
感謝各位的閱讀!關(guān)于.net怎樣獲取xml節(jié)點(diǎn)或者屬性大值就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到吧!