[jdom-interest] Sorting JDOM lists

Jason Hunter jhunter at xquery.com
Mon Mar 8 10:08:12 PST 2004

> Sorting could never change the parent. It just tries to add it in the 
> array at a different location.

As Rolf explained, the sort() algorithm has the same element temporarily 
exist in two locations in the list.

> Well... why throw the error when the parent hasn't changed?

Because the same node instance can't exist at two locations in a 
document, even if under the same parent.  If you asked XPath for its 
following sibling, there would be two starting points.


More information about the jdom-interest mailing list