This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml

 
kalyan kiran
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
regards
kktata
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
Thanks.

------------------
L Goundalkar
lggoundalkar@hotmail.com
Sun Certified Programmer for Java 2 Platform
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic