Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing updated data in to DOM memory

 
s ithu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I am trying to delete a specified node in xml file using dom parser.It work perfectly alright in IDE output terminal but xml file is not updating.How to solve this problem?

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you use the DOM parser, it reads from the XML file and creates data structures (the DOM) in your computer's memory. When you delete the node from the DOM, that doesn't have any effect on the file you parsed from, it only affects the data in memory.

If you want the original file to be changed as well, then after you make your changes to the DOM you have to write the DOM out to that file. The Ranch has an FAQ page called Document To File (follow that link) which explains just how to do that.
 
s ithu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for your help.
The correct code is
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic