xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] How to transform a POJO to "nu.xom.Document" ?
- From: "Steve Loughran" <steve.loughran AT gmail.com>
- To: elharo AT metalab.unc.edu
- Cc: xom-interest <xom-interest AT lists.ibiblio.org>
- Subject: Re: [XOM-interest] How to transform a POJO to "nu.xom.Document" ?
- Date: Sat, 22 Dec 2007 15:16:31 -0800
On Dec 20, 2007 4:42 AM, Elliotte Rusty Harold <elharo AT metalab.unc.edu> wrote:
> Jin Xu wrote:
> > How to transform a POJO to "nu.xom.Document", please ?
> >
>
>
> Write the code to do it. There are no shortcuts. There is no object-XML
> mapping layer (and that's a feature, not a bug).
>
you could use something like JAXB to go POJO->XML, then parse the XML
into XOM. But you'd be exposed to the limitations of O/X mapping.
One option is to subclass all the Xom types, and build up your graph
using custom elements, then turn this straight into XML; provide a
custom factory to do the reverse at parse time. I've done this and it
works very well.
-
[XOM-interest] How to transform a POJO to "nu.xom.Document" ?,
Jin Xu, 12/19/2007
-
Re: [XOM-interest] How to transform a POJO to "nu.xom.Document" ?,
Elliotte Rusty Harold, 12/20/2007
- Re: [XOM-interest] How to transform a POJO to "nu.xom.Document" ?, Steve Loughran, 12/22/2007
-
Re: [XOM-interest] How to transform a POJO to "nu.xom.Document" ?,
Elliotte Rusty Harold, 12/20/2007
Archive powered by MHonArc 2.6.24.