[jdom-interest] detach() [eg]

Jools jools at jools.org
Tue Apr 17 13:42:45 PDT 2001

Whilst working through the source code for Element.java I became
with the detach() method.

    public Element detach() {
        Element p = getParent();
        if (p != null) {
        else {
            Document d = getDocument();
            if (d != null) {
                d.setRootElement(new Element("placeholder"));
        return this;

Which means that if we detach a root element from Document it ends
up being a document with one root element <placeholder/>.

Do we really want this, or should we simply set the root Element to
null ?


More information about the jdom-interest mailing list