Java Utililty Methods XML Node Move

List of utility methods to do XML Node Move

  1. HOME
  2. Java
  3. X
  4. XML Node Move

Description

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

Method

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;
...

AltStyle によって変換されたページ (->オリジナル) /