[jdom-interest] JDOM Parsing - Iterating Through Elements Named the Same

Alex Rosen arosen at silverstream.com
Tue Dec 11 11:24:47 PST 2001


Did you look at the JDOM JavaDoc? e.g. the Element.getChildren() methods?

Alex

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Hunter Hillegas
> Sent: Monday, December 10, 2001 2:40 PM
> To: JDOM-Interest mailing list
> Subject: [jdom-interest] JDOM Parsing - Iterating Through 
> Elements Named
> the Same
> 
> 
> I have an XML file like this:
> 
> <file>
>     <service id="0"><stuff></stuff></service>
>     <service id="1"><stuff></stuff></service>
>     ...
>     <service id="9"><stuff></stuff></service>
> </file>
> 
> There can be an arbitrary number of <service> elements, but I 
> always want
> the last one.
> 
> Is there a way to iterate through elements that have the same 
> name to get to
> the end?
> 
> What is the best way to do this?
> 
> Thanks,
> Hunter
> 
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/yo
uraddr at yourhost.com



More information about the jdom-interest mailing list