[jdom-interest] Recursively Modifying the JDOM before output.

Kenworthy, Edward edward.kenworthy at exchange.co.uk
Mon Jun 4 23:44:12 PDT 2001


As someone who was caught by setText's destructive behaviour I agree that it
shouldn't be changed to add before or after - personally I think it should
be removed or its name changed to setContents() or perhaps
setTextAndWipeOutAllChildElements() ;-)

Edward

-----Original Message-----
From: philip.nelson at omniresources.com
[mailto:philip.nelson at omniresources.com]
Sent: 05 June 2001 03:12
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Recursively Modifying the JDOM before
output.



> >Maybe it should have been bold.  Anyway, seems like setText() adding
> >before or after child elts feels good to people.  So which: before or
> >after?  :-)
> >
> 
> NO NO NO A THOUSAND TIMES NO! This is not a good idea. It does not 
> feel good to me. The current behavior is by far the most intuitive. 
> We should keep it. If it's really too surprising to people (I don't 
> think it is) then we should delete this method. But JDOM should not 
> be making implicit assumptions about how to intermingle text with 
> child elements.

Though the setText result of destroying the content is unexpected, it's easy
to discover and correct.  I think choosing a way to add text with setText is
worse.  I think we should leave it as it is.
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list