Java Utililty Methods XML Node Move

List of utility methods to do XML Node Move

Description

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

Method

voidmoveDown(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);
...
booleanmoveNodeDown(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;
...
booleanmoveNodeUp(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;
...