Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java & XML

 
Gemini Rana
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anybody help me out with XML programming. I want to read a XML file and search through it or delete a node in it or a add a new node in it or modify the value of a existing node in it. Could anyone help me out from this dreaded situation. I m relatively new to XML programming with JAVA but not JAVA.

bye
 
Makarand Parab
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi RANA
There are 2 ways to work with XML, one is SAX and other is DOM. Looking at ur problem u need to work with DOM. In dom, the whole xml data is loaded in the memory as a DOM object, then u can add a node, delete a node, update data in it.
U can read more details on DOM and then code your application. Let me know if u need any help. I would look forward to help u out. u can mail me at makarandparab@indiatimes.com.

Enjoy

Regards
Makarand Parab
 
sweta naidu
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rana,
Use JDOM api.browse through the documentation and look for examples that will give you an idea.
 
Baps Vakkalagadda
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try JAXB. It is more efficient than DOM and easier than SAX.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic