List of utility methods to do XML Node Move
void | moveDown(final Node currentN) move Down Node nextSibling = findNextElement(currentN, false); Node nextNextSibling = findNextElement(nextSibling, false); Node parent = currentN.getParentNode(); parent.removeChild(currentN); if (nextNextSibling != null) { parent.insertBefore(currentN, nextNextSibling); } else { parent.appendChild(currentN); ... |
boolean | moveNodeDown(Node node) Move an element prior to his previous sibling. Node parent = node.getParentNode(); Node next = node.getNextSibling(); if (next != null) { parent.removeChild(node); insertAfter(parent, node, next); return true; return false; ... |
boolean | moveNodeUp(Node node) Move an element prior to his previous sibling. Node parent = node.getParentNode(); Node previous = node.getPreviousSibling(); if (previous != null) { parent.removeChild(node); parent.insertBefore(node, previous); return true; return false; ... |