Meaningless Drivel is fun!
The moose likes XML and Related Technologies and the fly likes xml 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 "xml" Watch "xml" New topic


kalyan kiran

Joined: Aug 21, 2001
Posts: 5
I have got a jsp page and a list of records are being displayed in the jsp page and now i have three options insert delete and update. if i click delete it should go to the xml file and delete
that particular record and if i say update it update that particular record in the xml and insert means it should append the record to the xml file without modifying the existing one.please let me know on this aspect about how to approach about
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
You can have two approaches for this.
1. Client Side Manipulation.
I think you can use Javascript and DOM parser to manipulate the XML file and once the user exits the page you can send the whole XML file to server for archiving it on Server.
2. Server Side Manipulation.
Simple, use the same DOM parser and update the XML source through the API available. In this case everytime the client chooses an operation it has to send the data to server to update.
While choosing the Parse you have to use DOM one, cuz you can't add, delete or modify an XML file using SAX parsers.
I think this is a generalised solution for your query. If yu need a specific one please ask.

L Goundalkar
Sun Certified Programmer for Java 2 Platform

Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Call me a pessimist, but I never trust the user. I would go with the server side option unless maybe someone here at the Javaranch can convince otherwise
I agree. Here's the link:
subject: xml
It's not a secret anymore!