mike mcintyre's

.N e t J o u r n a l

vbCity Blogs moved to:
http://cs.vbcity.com/blogs
  Home :: Syndication  :: Login

OctNovember 2009Dec
SMTWTFS
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

Topics

Source Code

Download Source Code:  Read XML Document with XPathNavigator

The .NET 2.0 XmlNavigator class provides a cursor model for navigating and editing XML data. This short article and download provide an introduction to using the XPathNavigator to read XML documents.

The download contains two examples: one that reads an XML document  that contains a default namespace and one that reads and XML document that does not contain a default namespace.

An XPathNavigator object is created from a class that implements the IXPathNavigable interface such as the XPathDocument and XmlDocument classes.

 

        ' Declare a variable named theXPathNavigator of type XPathNavigator.

        Dim theXPathNavigator As XPathNavigator

        ' Call the peopleXmlDocument object's CreateNavigator method

        ' assigning the resulting XPathNavigator object to theXPathNavigator variable.

        theXPathNavigator = peopleXmlDocument.CreateNavigator

Click the link above to download Visual Basic source code in a Visual Studio 2005 solution which demonstrates how to use the XPathNavigator class to read XML documents.
 
Mike McIntyre
http://www.getdotnetcode.com
 
posted on Monday, September 04, 2006 10:58 AM