Java Utililty Methods XML Node Insert

List of utility methods to do XML Node Insert

Description

The list of methods to do XML Node Insert are organized into topic(s).

Method

voidinsertAfter(Node newNode, Node refNode)
Analogous to the Node.insertBefore() method, insert a newNode after a refNode.
Node parent = refNode.getParentNode();
Node next = refNode.getNextSibling();
if (next == null) {
    parent.appendChild(newNode);
} else {
    parent.insertBefore(newNode, next);
voidinsertAfter(Node refNode, Node newNode)
Insert a node directly after a reference node.
refNode.getParentNode().insertBefore(newNode, refNode.getNextSibling());
voidinsertBefore(Node currentNode, Node insertNode)
insert Before
currentNode.getParentNode().insertBefore(insertNode, currentNode);