Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java data objects to XML

Reply
Thread Tools

Java data objects to XML

 
 
dada rara
Guest
Posts: n/a
 
      07-02-2003
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


 
Reply With Quote
 
 
 
 
Mikkel Heisterberg
Guest
Posts: n/a
 
      07-02-2003
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

dada rara wrote:
> 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
>
>


 
Reply With Quote
 
 
 
 
Peter Schoaff
Guest
Posts: n/a
 
      07-02-2003
Mikkel Heisterberg <> wrote in message news:<>...
> 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
>


Or Electric XML from www.themindelectric.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data between objects and calling all objects of a class in turn ghoetker Python 1 08-25-2010 03:18 AM
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
design patterns: value objects vs. data transfer objects laredotornado@zipmail.com Java 1 08-29-2006 12:14 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
JRuby: How does one keep Java objects as Java objects so they can be used in method calls? Steve Drach Ruby 3 06-19-2004 11:25 PM



Advertisments