Xmlnode_Object SetElement Method

Changes the value of an existing child element.
xmlnode_object.SetElement(element, new_value)

Prerequisites

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

Parameters

element

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

new_value

A required String expression that specifies the new value of the element.

Remarks

This is a convenience method that modifies an element value in a DOM tree. The new_value replaces the old value of the element. The element must be an immediate child of the current node. If the element 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 for section 1")
root.SetElement("section1", "New data for section 1")

See Also

XML Classes | xmlnode_object.GetElement | xmlnode_object.SetAttribute