After playing with it a bit, we will go with jibx instead (Thanks Florian)
mainly  because of  performance and  its java-centric XML mapping approach.
That said, how come we don't see jibx on
http://maven.restlet.org/org/restlet/. I do see jaxb there.

Thanks
dev

On Jan 27, 2008 10:22 AM, dev dev <[EMAIL PROTECTED]> wrote:

> Great help Florian. We will definitely take a look at Jibx representation
> before considering JAXB.
>
> Thank you.
> dev
>
>
> On Jan 27, 2008 1:17 AM, Florian Schwarz <[EMAIL PROTECTED]>
> wrote:
>
> > Hi dev,
> >
> > the usage of JaxbRepresentation is quite simple:
> >
> > Java -> XML
> >
> > public Representation represent(Variant variant) {
> >
> >    ...
> >    Flight flight = ...
> >    JaxbRepresentation jaxbRepOfMyFlight = new
> > JaxbRepresentation(MediaType.TEXT_XML, flight);
> >    ...
> >    return jaxbRepOfMyFlight
> > }
> >
> >
> > XML -> Java
> >
> > JaxbRepresentation jaxbRep = new
> > JaxbRepresentation(response.getEntity(), "com.mycompany.entity.jaxb");
> > try {
> >    Flight flight = (Flight) jaxbRep.getObject();
> >    } catch (IOException e) {
> >            ...
> > }
> >
> > where the package com.mycompany.entity.jaxb is the JAXB-context-path
> > with the existing Java domain objects (eventually created vom xsd).
> >
> > If you start from your domain objects and not from your xsd, I recommend
> > using JIBX instead of JAXB. See also:
> >
> > http://article.gmane.org/gmane.comp.java.restlet/3858/match=jibxRepresentation
> >
> > There is an performance comparison between different XML binding
> > frameworks at:
> > http://www.ibm.com/developerworks/xml/library/x-databdopt2/
> >
> > Cheers
> > Florian
> >
> > dev dev schrieb:
> > > Hi folks,
> > >
> > > has anybody already used the JAXB XML binding framework with Restlet?
> > > Are there any sample codes we can take a look at on how it's being
> > > used in Restlet? Any performance issues we should seriously consider
> > > before using JAXB?
> > >
> > > Thanks in advance for all the help.
> > >
> > > dev
> >
> >
>

Reply via email to