Java data objects to XML

D

dada rara

I am trying to figure out a *smart* way of generating XML documents from
custom data objects. Of course, to be able to apply different XSLTs in the
presentation layer.

The custom data objects will be JavaBeans with attributes and/or collections
of other JavaBeans.

One way would be to create specific converter classes with hard coded XML
tags for each JavaBean that needs to be converted but that isn't very
maintainable. Changes in data objects require changes in the converter
classes.

I see two possibilities:

1. Having a more general converter that is able to convert data objects
according to some DTDs. DTDs could be used for mapping between the data
objects and wanted XML document.

2. Using some open source framework, Quick seems to be suitable.
http://qare.sourceforge.net/web/2001-12/products/quick/

Have any of you solved this problem previously?

David
 
M

Mikkel Heisterberg

Take a look at the JAXB (Java API for XML Binding) API from Sun or at
Castor which is an OpenSource framework that does the same thing but is
more mature and has been out far longer.

http://www.castor.org is the place to go...

lekkim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top