Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6090239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:11:30+00:00 2026-05-23T12:11:30+00:00

How could I parse my email values to my text box according to email

  • 0

How could I parse my email values to my text box according to email type. I need some help in parsing Emails values to my text-boxes.

<CONTACT>
<PDE-Identity>N65567</PDE-Identity>
<FirstName>Rangarajkarthik</FirstName>
<LastName>karthik Rangaraj</LastName>
<Facebook-ID/>
<EMAIL>
<Type>gmail</Type>
<Value>kart06@gmail.com</Value>
<Type>yahoo</Type>
<Value>karthikngaraj@yahoo.com</Value>
</EMAIL>
</CONTACT>

How can I parse the value of type to my textbox in XUL using a loop? In some contact nodes there is no Gmail and in some contact nodes there is no Yahoo email address. I’m really confused here…

<row>
    <label value="Gmail"/>
    <textbox id="gmail" value=""/>
</row>
<row>
    <label value="Yahoo"/>
    <textbox id="yahoo" value=""/>
</row> 

This is what I have so far:

var str=x[i].getElementsByTagName("Value")[0].childNodes[0].nodeValue;
document.getElementById("gmail").value=str;

It’s not working.

XUL code:

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" oncommand="init();">

  <grid>
    <columns>
      <column flex="1"/>
      <column flex="4"/>
       <column flex="4"/>
      <column flex="4"/>
       <column flex="4"/>
    </columns>

    <rows>
      <row>
<label control="" value="Select PDE-ID:"/>
<menulist id="List" oncomman="">
               <menupopup  id="Popup">
               </menupopup>
</menulist>

      </row>
    </rows>
</grid>

<label control="" accesskey="" value=""/>
  <grid>
    <columns>
      <column flex="1"/>
      <column flex="4"/>
        <column flex="4"/>
        <column flex="4"/>
<column flex="4"/>
    </columns>

    <rows>
      <row>
        <label value="PDE-Identity"/>
        <textbox id="pde" value=""/>
      </row>
      <row>
        <label value="FirstName"/>
        <textbox id="fname" value=""/>
      </row>
      <row>
        <label value="LastName"/>
        <textbox id="lname" value=""/>
      </row>
      <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>
          <label value="URL"/>
        <textbox id="facebook" value="" />
      </row>
      <row>
          <label value="Facebook-ID"/>
        <textbox id="fid" value="" />
      </row>
    </rows>
  </grid>
<label  value=""/>
<grid>
    <columns>
        <column flex=""/>
    <hbox align="center" >
        <button id="save"   label="next"   oncommand="next()" />
        <button id="cancel" label="previous" oncommand="previous()"/>
        <button id="delete" label="Merge"  oncommand="delete();"/>        
    </hbox>
</columns>
</grid>


<separator/>
<text value="© 2011"/>
<separator/>


<script type="application/x-javascript">
<![CDATA[




var objXMLDoc = document.implementation.createDocument('','doc',null);
var objXMLHTTP = new XMLHttpRequest();

objXMLHTTP.open("GET", "file://D:/xmlparserinxul/final.xml", false);
objXMLHTTP.send(null);
objXMLDoc = objXMLHTTP.responseXML;

var objNodeList = objXMLDoc.getElementsByTagName("PDE-Identity");
   for (var i=0; i<objNodeList.length; i++){
            var menuPopup=document.getElementById('Popup');             
                     var menu1=document.createElement("menuitem");
                        menu1.setAttribute("label",'objNodeList');
                       menuPopup.appendChild(menu1);
}


var x = objXMLDoc.getElementsByTagName("CONTACT");
i=0;

function init()
{

var str=x[i].getElementsByTagName("PDE-Identity")[0].childNodes[0].nodeValue;
document.getElementById("pde").value=str;

var str=x[i].getElementsByTagName("FirstName")[0].childNodes[0].nodeValue;
document.getElementById("fname").value=str;

var str=x[i].getElementsByTagName("LastName")[0].childNodes[0].nodeValue;
document.getElementById("lname").value=str;

/*var str=x[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue;
document.getElementById("gmail").value=str;

var str=x[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue;
document.getElementById("yahoo").value=str;

var str=x[i].getElementsByTagName("Type")[0].childNodes[0].nodeValue;
document.getElementById("alcatel-lucent").value=str; */

var str=x[i].getElementsByTagName("URL")[0].childNodes[0].nodeValue;
document.getElementById("facebook").value=str;

var str=x[i].getElementsByTagName("Facebook-ID")[0].childNodes[0].nodeValue;
document.getElementById("fid").value=str;

}

function next()
{

document.getElementById('facebook').value='';
document.getElementById('fid').value='';
//alert('fool');
if (i<x.length-1)
  {
  i++;
  init();

  }
}

function previous()
{

document.getElementById('facebook').value='';
document.getElementById('fid').value='';

if (i>0)
  {

  i--;
  init();

  }
}


]]>
</script>

</window>

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_ie@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.ghbel@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>karthye@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>kart06@gmail.com</Value>
<Type>yahoo</Type>
<Value>karthikngaraj@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>akkiredch@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>Vea_Kumar</LastName>
<Facebook-ID/>
<EMAIL>
<Type>yahoo</Type>
<Value>KURg_81@yahoo.com</Value>
</EMAIL>
</CONTACT>
</CONTACTS>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:11:31+00:00Added an answer on May 23, 2026 at 12:11 pm

    I think you are mixing up XUL and the XML format. XUL is a XML User Interface Language which mean that it describes the Use interface in an XML format.
    The getElementsByTagName and getElementById functions aim at accessing XUL elements, i.e. UI elements, through their ids or tag name.
    You cannot/shoudn’t modify XML data using these functions. To process XML data in javascript you should use E4X. You can find a nice tutorial here. You should find the solution to what you need inside.

    By the way, since the order of two siblings node in a XML data is not important, I would suggest you, for each Email address to create a parents node including the email value and the type:

    <EMAILS>
      <EMAIL>
        <Type>gmail</Type>
        <Value>kart06@gmail.com</Value>
      </EMAIL>
      <EMAIL>    
        <Type>yahoo</Type>
        <Value>karthikngaraj@yahoo.com</Value>
      </EMAIL>
    </EMAILS>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have users sending emails with some text I need to extract. Each user's
I wonder if someone could help me figure out how to parse a string
I need to parse html emails that will be similar but not exactly the
I'm writing some code to parse forwarded emails. What I'm not sure is if
How could i parse this type of json data, getting in results to fetch
is there a function in PHP that could parse the html data below to
I want to parse XML in bash and xpath could do it. (To get
I am using feedparser for parsing from XML file.But I couldn't parse <geo:lat> ,
I have such text: <Neednt@email.com> If you do so, please include this problem report.
I would like to parse a mailer to-string which could consist of the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.