Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] How to make the object of nu.xom.Document may toserialize ?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Steve Loughran" <steve.loughran AT gmail.com>
  • Cc: "XOM interest" <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] How to make the object of nu.xom.Document may toserialize ?
  • Date: Mon, 10 Dec 2007 20:01:36 +0000

On Dec 10, 2007 7:25 PM, Tatu Saloranta <cowtowncoder AT yahoo.com> wrote:
> --- Steve Loughran <steve.loughran AT gmail.com> wrote:
>
> > On Dec 10, 2007 1:40 AM, Tatu Saloranta
> > <cowtowncoder AT yahoo.com> wrote:
> > > While this is certainly possible, the question is,
> why
> > > bother? Serialization to textual xml can be done
> ...
> > I'm not going to defend Java Serialisation overhead,
> ...
> > But there are a lot of places where it gets used,
> such as saving
> > session state in an app server, or chatting between
> processes in
> > EJB-land. Sometimes the things you send over dont
> ...
>
> Ah ok. Yes, this does make sense -- so sometimes it
> would be
> convenient (and even necessary) to be able to
> serialize xom
> documents and/or nodes. So basically it'd be for
> inter-operability reasons.

Exactly. And you can do it with a wrapper class, which is what you add
to the serialisation package:
http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/components/xml/src/org/smartfrog/services/xml/impl/SerializedXomDocument.java?view=markup

the document is marked as transient, and it implements the special
private methods needed to serialize/deserialize a document, so
marshalling it over RMI or similar. My design delegates serialisation
to a plug in codecl you could support the nux form fairly easily:
http://smartfrog.svn.sourceforge.net/viewvc/smartfrog/trunk/core/components/xml/src/org/smartfrog/services/xml/impl/codecs/

-steve




Archive powered by MHonArc 2.6.24.

Top of Page