CSharp examples for System.Xml:XPath
Xml Value from XPath
using System.Xml.XPath; using System.Xml; using System.Collections.Generic; using System;/*from ww w . j a v a2s. c om*/ public class Main{ public static string XmlVal(XmlDocument d, string path) { XPathNavigator navigator = d.CreateNavigator(); XPathNodeIterator iterator = navigator.Select(path); foreach (XPathNavigator n in iterator) { return n.Value; } return null; } }