View Single Post

  #1 (permalink)  
Old 02-01-2008, 12:16 PM
Nishanthhampali Nishanthhampali is offline
Junior Member
User
 
Join Date: Jan 2008
My distro: Debian
Posts: 3
Rep Power: 0
Nishanthhampali is on a distinguished road
Default Parse XML file and store data in array in shell scripting

Hello,
I have the XML file in the format

<Users>
<Host>
<hostAddress>180.144.226.47</hostAddress>
<userName>pwdfe</userName>
<password>hjitre</password>
<instanceCount>2</instanceCount>
</Host>
<Host>
<hostAddress>180.144.226.87</hostAddress>
<userName>trrrer</userName>
<password>jhjjhhj</password>
<instanceCount>3</instanceCount>
</Host>
<Host>
<hostAddress>180.455.226.87</hostAddress>
<userName>wewqw</userName>
<password>dfsdfd</password>
<instanceCount>3</instanceCount>
</Host>
</Users>

I have to read this xml file from the shell script and store the value of the tags hostAddress,username,password,instancecount in a separate arrays.

Please help me out in solving this.
Reply With Quote