Java XML Node Sibiling getNextSiblingElement(Node node)

Here you can find the source of getNextSiblingElement(Node node)

Description

get Next Sibling Element

License

Open Source License

Declaration

public static Element getNextSiblingElement(Node node) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

import org.w3c.dom.Element;

import org.w3c.dom.Node;

public class Main {
    public static Element getNextSiblingElement(Node node) {
        Node nextSibling = node.getNextSibling();

        while (nextSibling != null) {
            if (nextSibling.getNodeType() == Node.ELEMENT_NODE) {
                return (Element) nextSibling;
            }//www . j  a v  a 2 s .co m
            nextSibling = nextSibling.getNextSibling();
        }

        return null;
    }
}

Related

  1. getNextNamedSibling(Node node, String nodeName)
  2. getNextNodeSibling(Node node)
  3. getNextSibling(Node node)
  4. getNextSiblingElement(Node n)
  5. getNextSiblingElement(Node n, String ns, String localName)
  6. getNextSiblingElement(Node node)
  7. getNextSiblingElement(Node node)
  8. getNextSiblingElement(Node node)
  9. getNextSiblingElement(Node node)