Navigation

The root of a DOM tree is called the document element, and you can obtain a reference to this node using the DocumentElement property. The following code shows how you acquire the document element once you've parsed the file:

' Now we've parsed the file, get the Document Element Dim doc As XmlNode = xd.DocumentElement

The document element is of type XmlNode, as is everything in a DOM tree. If you receive a node reference and you want to find out what kind of node it is, the NodeType property will return one of the members of the XmlNodeType enumeration.

Once you have a node, the properties and methods of XmlNode enable you to find out information about the current node and navigate through the tree.

0 0

Post a comment