[jdom-interest] Insert an element in the middle of a list

Steven Gould steven.gould at cgiusa.com
Tue Feb 6 08:53:52 PST 2001


Steven,

Use the students Elements getChildren method. This returns a Java 2 List. You can then do whatever
List manipulations you want on that List. You can add new child Elements, remove Elements and move
Elements within the List. The changes will be reflected in your document.

Steve

---

Steven De Schutter wrote:

> Hello ,
>
> is it possible to add an element , not only at the end
> of the list , but perhaps also in front or somewhere
> between .
>
> Suppose i want to make an alfabetic list of students
> like this ...
>
> <students>
>   <ann>
>     <street> ... </street>
>   </ann>
>   <bart>
>     <street> ... </street>
>   </bart>
>   <steven>
>     <street> ... </street>
>   </steven>
> </students>
>
> How Can I add a student with name George to this list
> ???
>
> Greetings
> Steven
>
> =====
> |
> +-> SCOOPY  _______________________________________________
>     Steven De Schutter      Azalealaan 9, 2980 Zoersel
>     tel : 0497/256.326      Tel/Fax : (+32) 03.385.19.06
>     email : scoopy at freegates.be     sms : mr.scoopy at winbox.com ( Enkel voor spoedgevallen !!! )
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices.
> http://auctions.yahoo.com/
> _______________________________________________
> 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