aspose file tools*
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 Spring in Action this week in the Spring 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
Author

xml modification and generating a new one

Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113


I have one xml file like below

<name>
<firstname>001</firstname>
<lastname>gini1</lastname>
</name>

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.


thanks
Tanu Gulati
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
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.

Bill
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18659
    
    8

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.
 
 
subject: xml modification and generating a new one