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

skeens skeens at mobile.rogers.com
Fri Jun 1 14:25:59 PDT 2001


After thinking about it I'm not sure isetText() should even exist or if you want to continue using it then it should be renamed. Otherwise you will be getting this same question regularly.  I remember posting it myself.  At that time I remember being told setText() was a convenience method.  Since then I have never used it...so how convenient is it? 

Anyway, what about replaceAll(String) for an alternate method name?  It could be overloaded with replaceAll(Element) as well.
-----Original Message-----
From: Jason Hunter <jhunter at collab.net>
Date: Fri, 01 Jun 2001 13:40:55 -0700
To: Gary Montgomery <Gary.Montgomery at G11N.COM>
Subject: Re: [jdom-interest] Recursively Modifying the JDOM before output.

Gary Montgomery wrote:
> 
> So we save <kid/> off to the side with getChildren(). 
> setText("foo") changes the tree to:
> 
> <root>
> foo
> </root>
> 
> then after addChildren():
> 
> <root>
> foo
> <kid/>
> </root>

That's one workaround.  I'd like to have something better.

We could also just put the text before or after the other content?  That
might be less ugly.  Perhaps we could be fancy (too fancy?) and set it
at the first non-whitespace text node.  As a newbie, what would you
expect?

-jh-
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com



More information about the jdom-interest mailing list