Click here to Skip to main content
15,867,879 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
store data like name,address, city,state in xml file using html page with javascript
Posted
Updated 25-Jul-15 19:25pm
v2
Comments
barneyman 25-Jul-15 8:09am    
just guessing, but if you can't google for 'javascript xml', maybe coding isn't for you?

I guess that if you didn't choose one of the numerous library available, you want to do it yourself.

So, XML is simple text
For a single address, the XML file will look like:
XML
<?xml version="1.0" encoding="utf-8" ?>
<adress>
  <name>My Name</name>
  <street>My Street</street>
  <city zip="My Zipcode">My City</city>
  <state>My State</state>
</adress>
for a list of addresses:
XML
<pre lang="xml">&lt;?xml version="1.0" encoding="utf-8" ?&gt;
<list>
  <adress>
    <name>My Name</name>
    <street>My Street</street>
    <city zip="My Zipcode">My City</city>
    <state>My State</state>
  </adress>
  <adress>
    <name>My Name</name>
    <street>My Street</street>
    <city zip="My Zipcode">My City</city>
    <state>My State</state>
  </adress>
</list>
</pre>

Simple!
 
Share this answer
 
v2
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900