List of utility methods to do XML Node Previous
Node | getPreviousElementNode(Node node) get Previous Element Node Node previous = node.getPreviousSibling(); while (!(previous instanceof Element) && previous != null) { previous = previous.getPreviousSibling(); if (previous instanceof Text) { return null; return previous; ... |
Node | getPreviousNodeByName(Node currentNode, String tagName) Search up the tree for a given node Node node = currentNode.getParentNode(); while ((node != null) && (!node.getNodeName().equals(tagName))) { node = node.getParentNode(); return node; |
Node | getPreviousTypedNode(Node node, short nodeType) get Previous Typed Node node = node.getPreviousSibling(); while (node != null && node.getNodeType() != nodeType) { node = node.getPreviousSibling(); return node; |
Node | getPreviousTypedNode(Node node, short nodeType) get Previous Typed Node node = node.getPreviousSibling(); while (node != null && node.getNodeType() != nodeType) { node = node.getPreviousSibling(); return node; |
Node | getPreviousTypedNode(Node node, short nodeType) get Previous Typed Node node = node.getPreviousSibling(); while (node != null && node.getNodeType() != nodeType) { node = node.getPreviousSibling(); return node; |