O'Reilly logo

Microsoft® .NET Compact Framework Kick Start by Ronnie Yates, Erik Rubin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Navigating the XML DOM

Now that the XmlDocument is loaded, you can navigate its tree structure. Usually, you'll want to skip the XML declaration and other elements in the prolog and start directly at the root node. This can be done by using the DocumentElement property. This property returns the root element of the node tree.

The XmlDocument can be thought of as a node tree with links both down and up the tree. This allows for navigation in all directions: parent to child, child to parent, and sibling to sibling. The XmlNode abstract base class provides several methods for navigating the tree structure.

Navigating Using HasChildNodes and ChildNodes

The XmlNode provides the HasChildNodes property as an easy way to check whether the node is linked ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required