aspose file tools*
The moose likes XML and Related Technologies and the fly likes Create an XML file, write to it, search through the file, edit the file and then save it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Create an XML file, write to it, search through the file, edit the file and then save it" Watch "Create an XML file, write to it, search through the file, edit the file and then save it" New topic
Author

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

Giriraj Bhojak
Ranch Hand

Joined: Apr 03, 2008
Posts: 72
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

Joined: Aug 05, 2005
Posts: 3737
    
  16
You're probably better off using the built in xml support
XML Tutorial


Joanne
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
See also the excellent free online book by Harold.

It is loaded with examples.

Bill
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why not just create it with the right stuff in it in the first place?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Create an XML file, write to it, search through the file, edit the file and then save it