Hi Folks,

does the current API support it to inserting a element and its children
after the current element? The add Method of Element inserts a new child to it,
doesn't it!

Could't it be usefull to provide a instertAfter(Element element) Method in
Element (and its conrete impleantion AbstractElement). 

Currently I use java.util.List to achive that:

    Element parent = currentElement.getParent();
    List list = parent.elements();

    /* 
     * size()-1 is ugly but prevents ArrayOutOfBounds because size() is
always +1
     * as reale size
     */
    List subList = list.subList(parent.indexOf(currentElement)+1,
list.size()-1);
    list.removeAll(subList);
    list.add(elment);
    list.addAll(list.indexOf(dolly)+1, subList);

My question now: 1) Is there a easier way to achive that? 2) If not could we
add insertAfter(Element element) to the API ?

Regards

Toby

-- 
Machen Sie Ihr Hobby zu Geld bei unserem Partner 1&1!
http://profiseller.de/info/index.php3?ac=OM.PS.PS003K00596T0409a

--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to