[jdom-interest] Why should I have to detach()?

philip.nelson at omniresources.com philip.nelson at omniresources.com
Thu Mar 22 19:59:10 PST 2001


> I would like to know why?  Couldn't addContent() just detach
> the new child element automatically from it's parent before
> adding it?
> 
> The only reason I can see for doing that is to make
> the user explicately aware that they are detaching
> an element.  

I think that is the reason.  Yes you could detach the parent from the child.
But can you automatically detach the child from the parent's content?
Should you?  To me this is a little reasonable api reminder to pay
attention.  But then, I haven't had a reason to do it myself!



More information about the jdom-interest mailing list