[jdom-interest] Updates since Beta 9

Jason Hunter jhunter at acm.org
Tue May 27 10:21:40 PDT 2003


Alex Rosen wrote:
>>Are you saying you'd want an element.sort(Comparator) method?
> 
> Hmm...  Come to think of it, it'd probably be better as sample code, to
> show (one way of) ordering Elements interspersed with formatting-only
> whitespace, and not have all the whitespace end up and the beginning or
> end. I posted something a while back, I'll find it and submit it.

Yeah, I found that post this weekend and put it in my "good for the faq" 
folder.  The code was pretty complicated though because of your efforts 
to preserve the interspersed whitespace.  If you're willing to blow away 
whitespace (and let it get added again on output perhaps) it should be 
pretty straightforward.  Get child elements, sort, set them as the new 
content.  Both approaches have the problem that comments and PIs are 
hard to handle.

-jh-




More information about the jdom-interest mailing list