• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create XML string From Arraylist in Java

 
ankit mahajan
Greenhorn
Posts: 7
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create an XML string from data retrieved from the database in a ResultSet in java.
Can I do so by using Collection ArrayList.
If yes then how?
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4690
337
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, and it doesn't matter if it is an ArrayList or any other data structure populated with the contents you want to write to XML. Read XML FAQ for a list of APIs you can use to read/write XML contents.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recall that XML is just text with a strict format requirement so you can create an XML document with simple println() statements if you want to.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic