HI guys ,
I am building a dom handler for handling xml file ,in core java .
I did the following methods
createxml :Create xml file from a database and save in local machine
parser method : give parser out put of xml file
Display:display xml file in a Jsp page as well as in IDE output terminal
Deletenode: delete node whose name is passed
insertnode: append a child node at the end of file
searchnode : search node whose name is passed and display its count
I have doubt in delete and insert methods.should i delete all nodes in the file or only first node?
should i put provision to insert more child node?
I do nt knw the requirements of the project.
But I intend to build a standard Dom Handler so that it can be used in future also.
I have only used a few of the org.w3c.dom methods -
For deleting nodes the method I have used is http://docs.oracle.com/javase/6/docs/api/org/w3c/dom/Node.html removeChild() method that will remove the specified node. So you can have your implementation like the user has to specify the node to be deleted than you having logic of deleting all nodes or first node when calling delete node. If the user needs to delete more than one node, then he can call the delete node method in a loop.