Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to update a node, using SAX & saving updation in the same xml file?

 
deepesh shah
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
well i m new to xml , looking for an efficient way to read an xml file change/update certain node's value, or attribute and saving the same xml file, if possible this should happen while reading the file itself with xml reader, any help.!
deep deepeshshah@hotmail.com
 
Jean-Baptiste David
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi !
I think you can't save your changes with SAX... only DOM can do it
 
Shoba Ramachandran
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot update XML document using SAX, you have to use DOM. With DOM too it is not possible to update the document while reading itself. You can update the document once the parser reads the document and has DOM tree in memory.
Thanks
Shoba
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic