List of utility methods to do XML Node Insert
void | insertAfter(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); |
void | insertAfter(Node refNode, Node newNode) Insert a node directly after a reference node. refNode.getParentNode().insertBefore(newNode, refNode.getNextSibling()); |
void | insertBefore(Node currentNode, Node insertNode) insert Before currentNode.getParentNode().insertBefore(insertNode, currentNode); |