[jdom-interest] detach() [eg]

Jason Hunter jhunter at collab.net
Sat Apr 28 16:57:22 PDT 2001


> In the examples you give for detaching an Element, you always include the
> state checks (isRootElement) -- as if (re)moving a root is a perfectly
> normal thing to do.  

I believe moving a root to another document is normal behavior, as
evidenced by people writing to the list saying they are doing it.

> Yet, you argue that consumers of Document don't need to
> check the state of the Document because removing the root from a Document is
> a special case and not part of the normal flow of control.  

Passing a rootless document to a consumer (like XMLOutputter) can be
considered a programmer error and "not part of normal flow of control".

-jh-



More information about the jdom-interest mailing list