Jump to content

[solved]XML Parse Javascript


karthikin
 Share

Recommended Posts

Hi Guys, please help me to parse this xml file in javascript.This is part of my xml file:

<?xml version="1.0" encoding="UTF-8"?><CONTACTS><CONTACT><PDE-Identity>N65539</PDE-Identity><FirstName>Arun_niit</FirstName><LastName>Arun_niit</LastName><Facebook-ID/><EMAIL><Type>yahoo</Type><Value>nura_ice@yahoo.co.in</Value></EMAIL></CONTACT><CONTACT><PDE-Identity>N65546</PDE-Identity><FirstName>FodenBen'</FirstName><LastName>Ben' Foden</LastName><URL>http://www.facebook.com/profile.php?id=100002440474277</URL><Facebook-ID>100002440474277</Facebook-ID><EMAIL/></CONTACT><CONTACT><PDE-Identity>N65553</PDE-Identity><FirstName>GhorbelMahmoud</FirstName><LastName>Mahmoud Ghorbel</LastName><Facebook-ID/><EMAIL><Type>alcatel-lucent</Type><Value>mahmoud.ghorbel@alcatel-lucent.com</Value></EMAIL></CONTACT><CONTACT><PDE-Identity>N65560</PDE-Identity><FirstName>keyankarthik</FirstName><LastName>karthik keyan</LastName><Facebook-ID/><EMAIL><Type>yahoo</Type><Value>karthycse@yahoo.co.in</Value></EMAIL></CONTACT><CONTACT><PDE-Identity>N65567</PDE-Identity><FirstName>Rangarajkarthik</FirstName><LastName>karthik Rangaraj</LastName><Facebook-ID/><EMAIL><Type>gmail</Type><Value>kart2006@gmail.com</Value><Type>yahoo</Type><Value>karthikrangaraj@yahoo.com</Value></EMAIL></CONTACT><CONTACT><PDE-Identity>N65576</PDE-Identity><FirstName>ReddyAkky</FirstName><LastName>Akky Reddy</LastName><Facebook-ID/><EMAIL><Type>gmail</Type><Value>akkireddych@gmail.com</Value></EMAIL></CONTACT><CONTACT><PDE-Identity>N65583</PDE-Identity><FirstName>SandfordFrankie</FirstName><LastName>Frankie Sandford</LastName><URL>http://www.facebook.com/FrankieSandfordApprovedPage</URL><Facebook-ID/><EMAIL/></CONTACT><CONTACT><PDE-Identity>N65590</PDE-Identity><FirstName>TheSatsRochelle</FirstName><LastName>Rochelle TheSats</LastName><URL>http://www.facebook.com/profile.php?id=100002487211054</URL><Facebook-ID>100002487211054</Facebook-ID><EMAIL/></CONTACT><CONTACT><PDE-Identity>N65597</PDE-Identity><FirstName>KumarVeera</FirstName><LastName>Veera_Kumar</LastName><Facebook-ID/><EMAIL><Type>yahoo</Type><Value>KUMARg_81@yahoo.com</Value></EMAIL></CONTACT></CONTACTS>

This i smy part of my xul code:

<row>          <label value="Gmail"/>        <textbox id="gmail" value=""/>      </row>      <row>          <label value="Yahoo"/>        <textbox id="yahoo" value=""/>      </row>      <row>          <label value="Alcatel-Lucent"/>        <textbox id="alcatel-lucent" value="" />      </row>      <row> 

I know how to parse values the values for FirstName/LastName like this : getElementsByTagName("PDE-Identity")[0].childNodes[0].nodeValue; and I can put it in textbox:id.value; Serious I don't how to parse the Email values. Please help me guys. Thank you.

Edited by karthikin
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...