aspose file tools*
The moose likes XML and Related Technologies and the fly likes problem in deleting the file 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 "problem in deleting the file" Watch "problem in deleting the file" New topic
Author

problem in deleting the file

madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi,
in my project...i need to do delete operation..i developed one XML file...when i do delete..it is deleting the whole information in the xml file....what ever value i enter in the jsp page it should take that value and do delete operation...for deleting i wrote servlet coding...here is my code...can anyone help me where i wrote wrong...

delete.java



thanks,
madhu.
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
can anyone help me im waiting for the reply..where my code goes wrong..
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 532

Hi Madhu,

Just comment out this

and change this line

to

in delNode function...
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
hi,
thanks for your reply..i tried it is deleting only one line...in my xml file i need to delete whatever pack name entered...it should delete..here im attaching my xml file..if you see my xml file you'll see <MA98>,<MA99>,<MA03>..i need to delete <MA03> means that file should not be there..can you tell me where to do

madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
my xml file



madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
prasad have you seen my xml file and suggest me how to do for deletion of 'Pack 1 or other packs'...
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 532

For that, You need to have a for loop inside if (child.getNodeName().equals(filter)) and get all its child elements one by one and delete them...
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
kk..i'll try i had another doubt..is i had done modification..but the modification is happening at the end of my xml file...but i need is i used to enter the 'Pack Name' in jsp page..by taking that 'Pack Name' it should check and it should do modification at that pack place...i had used for loop..but im unable to get it...here is my code..for modification

modify.java



can you check it and provide me where to do changes..
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
prasad have you got my problem
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 532

Ya.. I have got what your problem is, but please be limited to one problem in a topic and for every other problem, create a new topic for new discussions, so that, you may get other ranchers responses also...
madhuri kunchala
Ranch Hand

Joined: Mar 30, 2010
Posts: 350
k
Sridhar Gudipalli
Ranch Hand

Joined: Nov 02, 2005
Posts: 120


Sorry but my response is not related to your problem. But I was wondering why this method signature is like this? I mean bunch of parameters? Why dont you have a single or some less number of objects which contains these parameters? You are forcing method users to type all the parameters (I know now its private method)?


Sridhar Gudipalli|SCJP 6.0
SCWCD objectives
 
Consider Paul's rocket mass heater.
 
subject: problem in deleting the file