Xml.xmldom.IDOMNode.replaceChild

From RAD Studio API Documentation
Jump to: navigation, search


Delphi

function replaceChild(const newChild, oldChild: IDOMNode): IDOMNode; safecall;

C++

virtual HRESULT __safecall replaceChild(const _di_IDOMNode newChild, const _di_IDOMNode oldChild, _di_IDOMNode &__replaceChild_result) = 0 ;

Properties

Type Visibility Source Unit Parent
function public
Xml.Xmldom.pas
Xml.xmldom.hpp
Xml.xmldom IDOMNode

Description

Replaces one of this node's children with a specified node.

Use replaceChild to remove a child of this node and replace it with the node specified by newChild. If the new node is already in the document's node hierarchy, it is first removed from its parent node.

If this node is read-only, refChild is a node that is not in this node's child list, newChild was created using a different document, or if newChild is of a nodeType that is not permitted as a child of this node, replaceChild raises an exception.

newChild is the child node that replaces oldChild. It can be a node that currently has another parent node, or a new node created using the methods of the document interface. If it is of nodeType DOCUMENT_FRAGMENT_NODE, the entire contents of the document fragment are moved into this node's childNodes property list.

refChild is a child that newChild replaces. If refChild is nil (Delphi) or NULL (C++), the new node is added to the end of this node's child list.

replaceChild returns the interface for refChild (the replaced node).

See Also