List of usage examples for org.dom4j.dom DOMNodeHelper getPreviousSibling
public static org.w3c.dom.Node getPreviousSibling(Node node)
From source file:org.nuxeo.automation.scripting.blockly.converter.BlockHelper.java
License:Open Source License
public static Element getPreviousBlock(Element block) { if (!"block".equals(block.getName()) && !"placeHolder".equals(block.getName())) { throw new UnsupportedOperationException(block.getName() + " is not a block!"); }//from w w w . j a v a 2 s .co m Element parentBlock = block.getParent(); if ("next".equals(parentBlock.getName())) { return parentBlock.getParent(); } return (Element) DOMNodeHelper.getPreviousSibling(block); }