1 Reply Latest reply on Jun 8, 2009 6:08 AM by Richard_Abbott

    How to display data in combo box from xml file.

    Raghuvasa Level 1

      Hi All,

       

       

              I have the data in xml file.

       

        <jukebox>

       

          <song>
              <title>When the Levee Breaks</title>
              <artist>Kansas Joe and Memphis Minnie</artist>
              <url>delhi601(www.songs.pk).mp3</url>
          </song>
          <song>
              <title>Better Leave that Stuff Alone</title>
              <artist>Will Shade</artist>
              <url>delhi601(www.songs.pk).mp3</url>
          </song>
          <song>
              <title>Walk Right In</title>
              <artist>Cannon's Jug Stompers</artist>
              <url>delhi601(www.songs.pk).mp3</url>
          </song>

       

      </jukebox>

       

       

      and i want to display the only url in combo box list. for that how can load this xml file and how can i show.

       

      Can any one help me.

       

       

      thanks

      Raghu.

        • 1. Re: How to display data in combo box from xml file.
          Richard_Abbott Level 3

          Raghuvasa,

          Get the XML file data into an XML variable in your code, say var jukebox: xml. Then do

          combo.dataProvider = jukebox.song.url

          or as a shortcut

          combo.dataProvider = jukebox.descendants("url")

          The latter will pull out elements with tag name url at any depth in the xml structure, so sometimes you have to be careful, but in your case there should be no problem.

          Richard