Table of Contents

Method Replace

Namespace
DotNetBrowser.Dom
Assembly
DotNetBrowser.dll

Replace(INode, INode)

Replaces an existing child node with a new node. The new node could be an existing node in the document, or you can create a new node. If the newNode is an existing node, it will be moved to new location in the document.

bool Replace(INode newNode, INode oldNode)

Parameters

newNode INode

the new node for replacement.

oldNode INode

the existing node, which will be replaced by newNode.

Returns

bool

true if the oldNode was successfully replaced with the newNode.

Remarks

The old node could be used for inserting/appending it into the document later.

Exceptions

ArgumentException

The newNode or the oldNode is null.

ObjectDisposedException

The INode has already been disposed.