IHasXmlNode.GetNode Method ()

 

Returns the XmlNode for the current position.

Namespace:   System.Xml
Assembly:  System.Xml (in System.Xml.dll)

XmlNode GetNode()

Return Value

Type: System.Xml.XmlNode

The XmlNode for the current position.

The following C# code uses GetNode to access a node the XPathNavigator is currently positioned on.

XmlDocument doc = new XmlDocument();
doc.Load("books.xml");
XPathNavigator nav =  doc.CreateNavigator();
XmlNode node = ((IHasXmlNode)nav).GetNode();
Console.WriteLine(node.LocalName); 
//You can edit the returned XmlNode.

.NET Framework
Available since 1.1
Return to top
Show: