File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xml modification and generating a new one Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml modification and generating a new one" Watch "xml modification and generating a new one" New topic

xml modification and generating a new one

Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113

I have one xml file like below


I wanted to create 100 xml files using some program with just one requirement, in my every new xml first name value should be increased by 1 always like next xml will have value <firstname> 002</firstname>

can any one suggest me in this regard.

Tanu Gulati
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Just do it with normal character output streams, no need to get fancy.

XML is not magic, if you just println() the tags and follow the XML rules you will get a valid document.

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

You want to create 100 XML files? Then split your problem into two parts:

(1) Find out how to create one XML file.

(2) Find out how to do something 100 times.

Combine the two into one and you're done.
I agree. Here's the link:
subject: xml modification and generating a new one
It's not a secret anymore!