Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating XML having multiple nesting of elements, from a ResultSet Object

 
Nikhil Vasaikar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I create an XML which has multiple nesting of parent and child nodes?
I have my data in a ResultSet Object.
[ October 01, 2003: Message edited by: Nikhil Vasaikar ]
[ October 01, 2003: Message edited by: Nikhil Vasaikar ]
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nikhil Vasaikar:
How do I create an XML which has multiple nesting of parent and child nodes?
I have my data in a ResultSet Object.

Could you please tell me an example of what you mean by multiple nesting of parent and child nodes in XML
 
Nikhil Vasaikar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The entire <ABCD> can be one row in the database
or There might be multiple internal tags say <ASD> representing multiple rows in the database. The data other than <ASD> will remain same in such case.

EDIT: I added CODE tags for you...
[ October 01, 2003: Message edited by: Lasse Koskela ]
[ October 02, 2003: Message edited by: Nikhil Vasaikar ]
 
Nikhil Vasaikar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Lasse.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Writing an xml is simillar to writing a simple text file. Unless you have some specific mapping conditions (that was specified in IBM tutorial i pointed earlier),all you have to do is read the resultset data objects and write them to the file(xml file) using java.io.*. But this is not the write approach when its comes to maintainance issue & elegancy but its solve the purpose.

Please also visit http://xml.apache.org/xindice/ and http://cocoon.apache.org/ to see whether it can solve your problem in longterm.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic