• Post Reply Bookmark Topic Watch Topic
  • New Topic

xml file generation  RSS feed

 
raj baig
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all

i am trying to generate a xml file from jsp dynamically from db as



it will give me like
<roottag>
<leaveinfo>
<xxx>somestring</xxx>
<year>someyear</year>
........
</leaveinfo>
</roottag>
but i want in some other format like

<roottag>
<leaveinfo xxx="somestr" year="someyear" ...>
<leaveinfo xxx="...." year="...." .....>
</roottag>

can some one help me with some example
 
chnaresh Cheedella
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why don't you try in this manner
while(rs.next()) {
outfile.write("<leaveinfo xxx="+rset.getDate("startdate")+" year="+rset.getString("Year")+.........+"/>");
}
 
Masoud Kalali
Author
Ranch Hand
Posts: 531
Java Mac OS X Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friend , can you tell me what is your problem ?
do you want to generate that xml file for users to download into thier local computers ?
what is your purpose of generating that xml file and what is your problem.

you can generate the xml file inside a Stringbuffer and then write it out using a cut. better way is to generate the xml file and then write it to the outputstream.
btw , give more details and probably more ranchers will come to your aid .
 
raj baig
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got it as naresh direction
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!