Xmlnode_Object GetElement Method

Returns a String that contains the value of a child element of the current node.

…xmlnode_object.GetElement(element)

Prerequisites

The current node must be of type "element" or "document".

Parameters

element

A required String expression that specifies the name of the child element to be found.

Remarks

This is a convenience method that finds a named element. The element must be an immediate child of the current node.

If an element with the specified name is not found, an exception is thrown.

Examples

Dim doc As XmlDoc 
Dim root As XmlNode
doc = New XmlDoc("my_doc")
root = doc.DocumentElement
root.AddElement("section1", "data")
Console.Writeline(root.GetElement("section1")) ' Output is "data"

See Also

XML Classes | xmlnode_object.GetAttribute | xmlnode_object.GetElementNode | xmlnode_object.SetElement