[jdom-interest] Jdom + something like getNextElement() ???

Guy Nirpaz guyn at tantian.com
Mon Nov 27 00:47:41 PST 2000


Hi,

Try using :

List students = studList.getChildren ( "student" ) ;
Iterator i = students.iterator () ;
while ( i.hasNext () ) {
    Element elem = (Element)i.next () ;
    ......
}

Since JDOM uses a List for collections, you should use the common
Collections API for iterations.

Guy

> Hello ,
>
> What for code do you have to use in your Java-program
> ( using JDOM ) if you want to retrieve the information
> of the next children ???
>
> Example ...
>
> <studentlist>
>     <student>
>         <name> Steven </name>
>         <class> 4ICT </class>
>     </student>
>     <student>
>         <name> Caroline </name>
>         <class> 4 OT </class>
>    </student>
> </studentlist>
>
> With ...
>
> Element root = doc.getRootElement();
> String name =
> root.getChild("student").getChild("name").getContent()
>
> you receive the information of student Steven ... but
> how can you get the information of the next node ( or
> how can you get the class of Caroline ???
>
> 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! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>




More information about the jdom-interest mailing list