Replaces this node with another node. If the specified node is this node, this method is a no-op. @param newNode the node to replace this one
(final DomNode newNode)
| 1230 | * @param newNode the node to replace this one |
| 1231 | */ |
| 1232 | public void replace(final DomNode newNode) { |
| 1233 | if (newNode != this) { |
| 1234 | final DomNode exParent = parent_; |
| 1235 | final DomNode exNextSibling = nextSibling_; |
| 1236 | |
| 1237 | remove(); |
| 1238 | |
| 1239 | exParent.insertBefore(newNode, exNextSibling); |
| 1240 | } |
| 1241 | } |
| 1242 | |
| 1243 | /** |
| 1244 | * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br> |