mike mcintyre's

.N e t J o u r n a l

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

AugSeptember 2006Oct
SMTWTFS
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

Archives

Topics

Source Code

Monday, September 04, 2006 #

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 @ 10:58 AM