Hi,
I've tried to get reatinAll(...) working with dom4j and I have problems.
Consider the following code:
public void deleteChildren(List aNameList) {
List listToRetain = new ArrayList(aNameList.size());
for (int i=0; i < aNameList.size(); i++) {
listToRetain.add(this.root.element((String)aNameList.get(i)));
}
this.root.content().retainAll(Collections.singletonList(listToRetain));
}
aNameList cotains the name of Elements as String. This code will complety
deletes all child nodes of root element. I replaced content() with elements()
and got the same result.
The method retainAll(...) works with equals() on java.lang.Object level.
Therefore I experimentd with createCopy(...) in order to get a better copy.
This won't work (because it's a deep copy ?). Setting the parent of such a
clone by yourself have no effect.
Any ideas to get this working?
Thanks
Toby
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
--
GMX Tipp:
Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-user