• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Iterating same level nodes

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi there,

<World>
<Country>Argentina</Country>
<Country>Bangladesh</Country>
<Country>China</Country>
<Country>Denmark</Country>
<Country>Iran</Country>
<Country>Iraq</Country>
</World>

how to iterate the above XML to get the Country's


Have a nice day
JB
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to get familiar with the standard Java library for manipulating XML.

Given the "World" org.w3c.Dom.Eement, you can getElementsByTagName("Country") to get a NodeList which you can use to iterate.

Bill

 
reply
    Bookmark Topic Watch Topic
  • New Topic