Sorry, but you haven't done your homework! Please, do read the VS2003 help on XPathNavigator, then, if you still have questions, do ask them.
In .NET 1.1 one can use the Select() method of XPathNavigator -- just read the examples in the online help.
The
SelectSingleNode(strSomeExpr)
method is just an abbreviation of
Select(strSomeExpr + "[1]")
Also, in .NET 1.1 the Select() method returns an XPathNodeIterator, so the code may look like this:
using System; using System.Xml.XPath;
public class Sample { public static void Main() {
XPathDocument doc = new XPathDocument("books.xml"); XPathNavigator nav = doc.CreateNavigator();
XPathNodeIterator ni = nav.Select("/bookstore/book/title"); while (ni.MoveNext()) Console.WriteLine(ni.Current.Value); } }
Cheers, Dimitre Novatchev
|