Hi, I wanna develop XML editor tool. Which does functions like parsing and giving the value if i give the node name. Can you please give me any URL or refer to some useful sites where i can get much more information on how to do this. Thanks.
Have you checked out JDOM already? Check out the org.jdom.input.SAXBuilder for ways to create a Document from an existing source. You can then get your root element.
Since my setup had no requirement of changing XML nodes, I just subclassed DefaultMutableTreeNode:
(GPL'ed ) As you see, the constructor creates the entire sub tree, so you only need to call the constructor yourself for the root node.
However, since you will be editing, you may choose to go for a custom TreeModel instead. The following is an example of how you could do it:
If you modify your DOM tree, don't forget to fire events for the TreeModelListeners though. Just look at the source of DefaultTreeModel (available in src.zip) at how to fire events. fireTreeNodesInserted is one of the event firing methods.