Java Code Examples for org.dom4j.Node#detach()

The following examples show how to use org.dom4j.Node#detach() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractType.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected static void replaceNode(Node container, Element value) {
	if ( container!=value ) { //not really necessary, I guess...
		Element parent = container.getParent();
		container.detach();
		value.setName( container.getName() );
		value.detach();
		parent.add(value);
	}
}
 
Example 2
Source File: CollectionType.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public void setToXMLNode(Node node, Object value, SessionFactoryImplementor factory) 
throws HibernateException {
	if ( !isEmbeddedInXML ) {
		node.detach();
	}
	else {
		replaceNode( node, (Element) value );
	}
}
 
Example 3
Source File: ResultsBuilder.java    From olat with Apache License 2.0 5 votes vote down vote up
private static void detachNodes(final String xPath, final Document doc) {
    final List xpathres = doc.selectNodes(xPath);
    for (final Iterator iter = xpathres.iterator(); iter.hasNext();) {
        final Node element = (Node) iter.next();
        element.detach();
    }
}
 
Example 4
Source File: ResultsBuilder.java    From olat with Apache License 2.0 5 votes vote down vote up
private static void detachNodes(final String xPath, final Document doc) {
    final List xpathres = doc.selectNodes(xPath);
    for (final Iterator iter = xpathres.iterator(); iter.hasNext();) {
        final Node element = (Node) iter.next();
        element.detach();
    }
}