Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create an XML file, write to it, search through the file, edit the file and then save it

 
Giriraj Bhojak
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way i can achieve above requirement in Java.
I tried using RandomAccessFile, but i do not know how to search in the file.

Basically i want to create an XML document, add elements to it, search through them, modify the elements and save them again.
All in one process.


Regards,
Giriraj.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're probably better off using the built in xml support
XML Tutorial
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See also the excellent free online book by Harold.

It is loaded with examples.

Bill
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just create it with the right stuff in it in the first place?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic