Java data objects to XML

Discussion in 'Java' started by dada rara, Jul 2, 2003.

  1. dada rara

    dada rara Guest

    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
    dada rara, Jul 2, 2003
    #1
    1. Advertising

  2. 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
    >
    >
    Mikkel Heisterberg, Jul 2, 2003
    #2
    1. Advertising

  3. 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
    Peter Schoaff, Jul 2, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    584
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 29, 2006
  2. Steven T. Hatton

    C++ objects that act like Java/C# objects.

    Steven T. Hatton, Jun 27, 2005, in forum: C++
    Replies:
    8
    Views:
    352
    Steven T. Hatton
    Jun 28, 2005
  3. 7stud
    Replies:
    11
    Views:
    688
    Dennis Lee Bieber
    Mar 20, 2007
  4. ghoetker
    Replies:
    1
    Views:
    376
  5. Steve Drach
    Replies:
    3
    Views:
    209
    Thomas E Enebo
    Jun 20, 2004
Loading...

Share This Page