using System;
using System.Xml.XPath;
using System.Xml;
class MainClass
{
static void Main(string[] args)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(@"c:\books.xml");
XPathNavigator nav = xmlDoc.CreateNavigator();
Console.WriteLine("Author First Name");
XPathNodeIterator itrator = nav.Select("descendant::first-name");
while( itrator.MoveNext() )
{
Console.WriteLine(itrator.Current.Value.ToString());
}
}
}
|