Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xml modification and generating a new one

 
Tanu Gulati
Ranch Hand
Posts: 113
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic