Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Participant
1745 Points
372 Posts
May 10, 2007 10:18 PM|LINK
Hey
you can try somethine like this:
XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(file); XmlNodeList nodeList = xmlDoc.SelectNodes("root/node");
foreach (XmlNode xmlNode in nodeList) { string strName = xmlNode.Attributes["val"].Value; int intStatsValue = Convert.ToInt32(xmlNode.InnerText);
//now you can store and compare the values }
Hope this helps.
Please don't forget to "Mark as Answer" if this post answered your question.
avidyarthi
Participant
1745 Points
372 Posts
Re: xpath how to find node with max attribute value
May 10, 2007 10:18 PM|LINK
Hey
you can try somethine like this:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(file);
XmlNodeList nodeList = xmlDoc.SelectNodes("root/node");
foreach (XmlNode xmlNode in nodeList)
{
string strName = xmlNode.Attributes["val"].Value;
int intStatsValue = Convert.ToInt32(xmlNode.InnerText);
//now you can store and compare the values
}
Hope this helps.
Please don't forget to "Mark as Answer" if this post answered your question.