Xmlnode_Object FirstChild Method

Returns the first child node of the current node.

…xmlnode_object.FirstChild

Prerequisites

None

Parameters

None

Remarks

This method returns a new XmlNode object that corresponds to the first child node of the current node. If the current node does not have any children, the returned object is Nothing. This method does not create a new node in the DOM tree.

Examples

Dim doc As XmlDoc 
Dim root As XmlNode
Dim elem1 As XmlNode
Dim
elem2 As XmlNode
doc = New XmlDoc("my_doc")
root = doc.DocumentElement
elem1 = root.AddElementNode("section1", "Data for section 1")
elem2 = root.AddElementNode("section2", "Data for section 2")
Console.Writeline(root.FirstChild.Name) ' Displays "section1"

See Also

XML Classes | xmlnode_object.LastChild | xmlnode_object.NextSibling | xmlnode_object.ParentNode| xmlnode_object.PreviousSibling