Hi Jared,

Maybe using XStream is a nice and simple solution....

*XStream* is a simple library to serialize objects to XML and back again

*xstream*.codehaus.org/

Ronald


2007/4/18, Sean Landis <[EMAIL PROTECTED]>:

Jared Nedzel <jnedzel <at> broad.mit.edu> writes:

>  So I'm considering return data as XML.
>
> So on the server side, I'm starting with a small network for Java
objects that
> have retrieved from the database (using Hibernate).  I need to convert
that XML
> and return the XML.  I'm NOT starting with static XML files and don't
want to
> write out XML files, only to read them back in as DOM objects.

Hi Jared,

Consider using JAXB. It provides a runtime that allows to easily translate
between XML and Java objects given an XSD. It is certainly more efficient
that
using DOM and a lot easier.

I created a JaxbRepresentation that was similar in nature to the
DomRepresentation and a JaxbFilter that is responsible for translating
incoming XML into objects and outgoing objects into XML.

This allows the server and Java clients to use only objects while allowing
the
service to talk XML.

Sean




Reply via email to