Java Utililty Methods XML Node Next

List of utility methods to do XML Node Next

Description

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

Method

ElementgetNextElementNode(Node node)
Returns the next Element node.
while (node != null) {
    if (Node.ELEMENT_NODE == node.getNodeType())
        return (Element) node;
    node = node.getNextSibling();
return null;
NodegetNextElementNode(Node node)
get Next Element Node
Node next = node.getNextSibling();
while (!(next instanceof Element) && next != null) {
    next = next.getNextSibling();
if (next instanceof Text) {
    return null;
return next;
...
NodegetNextNode(Node current)
get Next Node
if (current == null) {
    System.out.println("NODE IS NULL");
    return null;
boolean found = false;
boolean childVisited = false;
while (found != true) {
    if (current.hasChildNodes() && childVisited == false) {
...
NodegetNextNodeByName(Node currentNode, String tagName)
Search across the tree for a given sibling
return getNextSiblingByName(currentNode, tagName);
NodegetNextTypedNode(Node node, short nodeType)
get Next Typed Node
node = node.getNextSibling();
while (node != null && node.getNodeType() != nodeType) {
    node = node.getNextSibling();
return node;
NodegetNextTypedNode(Node node, short nodeType)
get Next Typed Node
node = node.getNextSibling();
while (node != null && node.getNodeType() != nodeType) {
    node = node.getNextSibling();
return node;
NodegetNextTypedNode(Node node, short nodeType)
get Next Typed Node
node = node.getNextSibling();
while (node != null && node.getNodeType() != nodeType) {
    node = node.getNextSibling();
return node;