[jdom-interest] Exception while sorting

Jason Hunter jhunter at servlets.com
Tue Aug 19 11:04:36 PDT 2003


Did you read the FAQ?

-jh-

d.breitenmoser at bluewin.ch wrote:

> Hi all
> 
> I try to sort a list of elements, but it occurs the following an exception.
> 
> Exception:
> ----------
> Exception in thread "main" org.jdom.IllegalAddException: The element already
> has an existing parent "catalog"
> 
> Code:
> -----
> Element root = data.getRootElement();
> List elements = root.getChildren();
>     
> Collections.sort(elements, new MyComparator(name));
> 
> Does anybody know why this error occurs ?
> 
> Cheers David
> 
> 
> _______________________________________________
> 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