Here you can find the source of getNextElementSibling(Node node)
Parameter | Description |
---|---|
node | the given node |
public static Element getNextElementSibling(Node node)
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**// ww w . j a va 2 s .c om * Returns the next sibling element of the given node. * * @param node * the given node * @return the next sibling element of the given node */ public static Element getNextElementSibling(Node node) { node = node.getNextSibling(); while (node != null) { if (node.getNodeType() == Node.ELEMENT_NODE) { return (Element) node; } node = node.getNextSibling(); } return null; } }