Xmlnode_Object LastChild Method

Returns the last child node of the current node.

…xmlnode_object.LastChild

Prerequisites

None

Parameters

None

Remarks

This method returns a new XmlNode object that corresponds to the last 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.LastChild.Name) ' Displays "section2"

See Also

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