• 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

Combo box with xml

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,

I have a xml in the following structure, i would like to build a combo box out of this. this xml is coming from the back end.
<?xml version="1.0" ?>
<divzones>
<divzonecode>code1</divzonecode>
<divzonename>zone1</divzonename>
</divzones>
<divzones>
<divzonecode>code2</divzonecode>
<divzonename>zone2</divzonename>
</divzones>
<divzones>
<divzonecode>code3</divzonecode>
<divzonename>zone3</divzonename>
</divzones>
i would like to convert this to following based on the xml received
<select>
<option value="code1">zone1</option>
<option value="code2">zone2</option>
<option value="code3">zone3</option>
</select>
i tired using getelementbytagname, but this will not take duplicate tags
KIndly help me in solving this
thanks in advance
rudresh
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
getElementsByTagName() returns an array of values.

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic