This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes How to insert data in xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to insert data in xml file" Watch "How to insert data in xml file" New topic
Author

How to insert data in xml file

Tuna Jen
Ranch Hand

Joined: Mar 18, 2009
Posts: 32
Hi Guys
I'm new to xml.As per requirement i've a xml file which contains some data as belows but i need to add data into the following xml file using java.can anyone please suggest me how to proceed.

out.xml
---------
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<tbl_sis_Products>
<product_id>1</product_id>
<product_code>LIP</product_code>
<product_name>Life Ins</product_name>
<product_description>Life Insurance Plan</product_description>
<is_active>true</is_active>
</tbl_sis_Products>
<tbl_sis_Products>
<product_id>2</product_id>
<product_code>REMCN</product_code>
<product_name>ExPIP</product_name>
<product_description>Professional Insurance Portfolio</product_description>
<is_active>true</is_active>
</tbl_sis_Products>
</NewDataSet>

Thanks in Advance....
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2801
    
    9

"Prince Point" please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.


SCJP, SCWCD.
|Asking Good Questions|
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
There are any number of APIs for altering XML files: DOM, XOM, JDOM, dom4j, ...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20080
    
  30

Moving to our XML forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: How to insert data in xml file
 
It's not a secret anymore!