Here you can find the source of getPreviousSiblingElement(Node node)
Parameter | Description |
---|---|
node | The start node. |
public static Element getPreviousSiblingElement(Node node)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { /**/*from w w w . jav a2 s. com*/ * Get the previous sibling element. * * @param node The start node. * @return The previous sibling element or {@code null}. */ public static Element getPreviousSiblingElement(Node node) { Node n = node.getPreviousSibling(); while (n != null && n.getNodeType() != Node.ELEMENT_NODE) { n = n.getPreviousSibling(); } return (Element) n; } }