Xmlnode_Object RemoveAttribute Method

Removes specified child attribute node and its subtrees from a DOM tree.

xmlnode_object.RemoveAttribute(attribute)

Prerequisites

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

Parameters

attribute

A required string expression that specifies the name of the attribute to be removed.

Remarks

This is a convenience method that finds and removes a child node that contains a specified attribute. The removed attribute node and any nodes beneath it are deleted and are no longer accessible. If an attribute is not found, an exception is thrown. The attribute must be immediate child of the current node.

Examples

Dim doc As XmlDoc 
Dim root As XmlNode
doc = New XmlDoc("my_doc")
root = doc.DocumentElement
root.AddAttribute("color", "orange")
root.RemoveAttribute("color") ' Attribute is removed

See Also

XML Classes | xmlnode_object.AddAttribute | xmlnode_object.RemoveChild | xmlnode_object.RemoveElement