[jdom-interest] detach() [eg]

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed Apr 25 19:21:11 PDT 2001


> Or is your argument that detach() should go away, that
> Element.removeContent() should remain, and that Document should thus
> have no way to detach its root short of the programmer substituting a
> new root in place of the old with setRootElement()?  Ugh.
> 

Ugh is right.  Though I respect the reasons given for wanting to do this,
the bottom line is that I don't want to force a user to put a bogus root
element in a document.  It accomplishes nothing and makes us look silly,
even though the real reason for doing so has merit.  You may be right, but
you're wrong :-)

> > I don't. What might make that "easier" makes it "Easier" 
> for folks to create
> > non-well-formed Documents. I thought that in recent mails, 
> we weren't going
> > to let non-well-formed things happen? 
> 
> Enforcing well-formed documents is a goal.  So is programmer
> ease-of-use.  This is one place where they're in conflict.  There's no
> easy answer, as evidenced by 50 emails on this subject.
> 

Absolutely! We are only refining the goal to say that jdom can only *output*
a well formed document. That's what really matters, isn't it?  We can output
an element and that is not a well formed document, it's a silly programmer
mistake.  What difference does it make if there is a document in memory that
is in an invalid state, if there are no lasting consequences?



More information about the jdom-interest mailing list