List of usage examples for org.dom4j.tree DefaultElement indexOf
public int indexOf(Node node)
From source file:com.mor.blogengine.xml.XMLHandlerImpl.java
License:Open Source License
/** * Append a node to parent node/* w w w . jav a 2 s . co m*/ * * @param root The node to add under * @param content what to add to root node * @return appended or not */ @Override public boolean append(DefaultElement root, DefaultElement content) { String elemID = root.valueOf("@ID"); DefaultElement elemInDoc = (DefaultElement) mRootElement.elementByID(elemID); if (elemInDoc != null) { elemInDoc.add(content); int indexOfappended = elemInDoc.indexOf(content); return (indexOfappended != -1); } return false; }