Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hi
i have fetched the data from an XML into an HTML webpage through JavaScript, and now if i make changes on my webpage(like selecting different radio button, checking a check box etc.) i want those changes made to be saved back in my XML. I have tried a lot but i don't know how to do that.
Please tell me any method of doing this.

Thanks
Posted
Updated 18-Feb-11 15:07pm
Comments
Sandeep Mewara 18-Feb-11 2:16am    
Share what you have tried or got error with.
Ankur\m/ 18-Feb-11 23:52pm    
OP wrote:
i read somewhere that XML is read only and changes can't be saved back. is this true? I tried with XML DSO. but xml dso loads the whole xml file in one go. i have to fetch different portions of data from same xml to different-different webpages. and this is no possible with DSO.
krumia 11-Feb-12 23:09pm    
It's not that XML can be saved back. It's a mess. XML not meant to save back. It is a good way to exchange data in a human readable format.

Furthermore, updating an XML file is very inefficient compared to using a database. And some web servers may not have the permission to update the disk files.
aidin Tajadod 18-Feb-11 12:41pm    
This is funny but may help you!

Try sending your page information to a server side page like asp, php or ..., then make your xml and send it back!
Ankur\m/ 18-Feb-11 23:53pm    
When you are replying to a comment, use reply link which is visible when you mover over the comment.

1 solution

XML is not meant to be used as a database. It is used to exchange machine readable data in a fairly human readable format.

What you can do is,
1. Use a database to store the data
2. Generate XML from the stored data dynamically
3. Use that XML to generate web pages, etc...
4. Save the change back to database, not XML

Writing code to update a database is far more easier than writing code to update a XML disk file.
 
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