List of utility methods to do XML Element Sibling
int | countPrecedingSiblingsOfType(Element inElem) count Preceding Siblings Of Type int cnt = 1; Node node = inElem.getPreviousSibling(); String typeName = inElem.getNodeName(); while (node != null) { while (node.getNodeType() != Node.ELEMENT_NODE) { node = node.getPreviousSibling(); if (node == null) { break; ... |
Element | getNextElementSibling(Element aElement) Gets the next sibling Element of a provided Element. Element theSibling = null; Node theCurrNode = aElement; while ((theCurrNode != null) && (theSibling == null)) { theCurrNode = theCurrNode.getNextSibling(); if ((theCurrNode != null) && (theCurrNode.getNodeType() == Node.ELEMENT_NODE)) { theSibling = (Element) theCurrNode; return theSibling; |
Element | getNextSibling(Element element) Get the next sibling element. return findNextSibling(element.getNextSibling());
|
Element | getNextSibling(Element h2) get Next Sibling Node node = h2.getNextSibling(); while (node != null && node.getNodeType() != Node.ELEMENT_NODE) { node = node.getNextSibling(); return getElement(node); |
Element | getNextSibling(Element node, String name) Get the next sibling element with the given name. final String filter = (name != null && !name.equals("*")) ? name : null; for (Node n = node.getNextSibling(); n != null; n = n.getNextSibling()) { if (n.getNodeType() == Node.ELEMENT_NODE && (filter == null || n.getNodeName().equals(filter))) return (Element) n; return null; |
Element | getNextSiblingElement(Element el) Get the next sibling element for (Node n = el.getNextSibling(); n != null; n = n.getNextSibling()) { if (n instanceof Element) { return (Element) n; return null; |
Element | getNextSiblingElement(Element elem) Return the next sibling element of the given element. for (Node n = elem.getNextSibling(); n != null; n = n.getNextSibling()) { if (n.getNodeType() == Node.ELEMENT_NODE) { return (Element) n; return null; |
Element | getNextSiblingElement(Element elem) Return the next sibling element of the given element. for (Node n = elem.getNextSibling(); n != null; n = n.getNextSibling()) { if (n.getNodeType() == Node.ELEMENT_NODE) { return (Element) n; return null; |
Element | getNextSiblingElement(Element element) get Next Sibling Element try { Node node = element.getNextSibling(); while (node != null && !(node instanceof Element)) { node = node.getNextSibling(); return (Element) node; } catch (IndexOutOfBoundsException e) { return null; ... |
Element | getNextSiblingElement(Element element) get Next Sibling Element Node sibling = element.getNextSibling(); while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE) sibling = sibling.getNextSibling(); return (Element) sibling; |