File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes Creating XML having multiple nesting of elements, from a ResultSet Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Creating XML having multiple nesting of elements, from a ResultSet Object" Watch "Creating XML having multiple nesting of elements, from a ResultSet Object" New topic
Author

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

Nikhil Vasaikar
Greenhorn

Joined: Sep 09, 2003
Posts: 22
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

Joined: Jul 13, 2001
Posts: 3150
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


Spritle Software Blogs
Nikhil Vasaikar
Greenhorn

Joined: Sep 09, 2003
Posts: 22

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

Joined: Sep 09, 2003
Posts: 22
Thank You Lasse.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating XML having multiple nesting of elements, from a ResultSet Object