CSharp examples for System.Xml:XPath
Xml Values from XPath
using System.Xml.XPath; using System.Xml; using System.Collections.Generic; using System;//w w w . j av a 2s . c o m public class Main{ public static IEnumerable<string> XmlVals(XmlDocument d, string path) { XPathNavigator navigator = d.CreateNavigator(); XPathNodeIterator iterator = navigator.Select(path); foreach (XPathNavigator n in iterator) { yield return n.Value; } } }