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
newNodeINodethe new node for replacement.
oldNodeINodethe existing node, which will be replaced by
newNode.
Returns
- bool
trueif theoldNodewas successfully replaced with thenewNode.
Remarks
The old node could be used for inserting/appending it into the document later.
Exceptions
- ArgumentException
The
newNodeor theoldNodeis null.- ObjectDisposedException
The INode has already been disposed.