How to delete a perticular node from xml file using java code
843834Jul 21 2006 — edited Jul 21 2006Hii All,
Now i am trying to delete a perticular node from xml file.Like...
XML file:
---------------------
<Licence>
<SERVER>
<was id="1">1</was>
<was id="2">2</was>
</SERVER>
</LICENCE>
-----------------------------
I am working in messaging service using JABBER framework with whiteboard facility.
Here Some commands i have created to add,modify,delete nodes from xml file.They Are
----
1.If u want to add a new node then.
create Licence.SERVER <ss id="3">ddd</ss> lic.xml
(here u want to add a new node called "ss" under Licence.SERVER.
And lic.xml is tyhe xml file name where it was saved.
-----
2.If u want to delete a node(Suppose <was id="1">),then the command should be
---
delete Licence.SERVER.was:id='"1" lic.xml
-----
A problem arises that here it find two was attributes.And it delete the last was attribute,not the requested node.
-------------------
PLEASE HELP ME IN SOLVING THIS CODE..
------------------------------------