XML data binding frameworks

Im looking for information on XML data binding frameworks. Having looked @ around I find i have 2 options

  1. Castor XML
  2. Apache digestor

Has anyone worked on either of these? Are there more frameworks out there?

I also found basic XML to java mapping info @

Whats the downside of using these frameworks then just using SAX or DOM? Any info is greatly appreciated.

Advertisements

10 thoughts on “XML data binding frameworks”

  1. I found Glue from themindelectric always very easy to use. It provides tools like schema2java and java2schema. Especially when it comes to consuming webservices, then Glue is a really neat tool (also has an Eclipse plugin by now).

    What I like about Glue is that you do not need to define a Mapping file like in Castor. What I like about Castor is that you have more fine-grain control. But I’m quite a rookie in xml data binding (after the http impedance mismatch and the OR impedance mismatch I was kind of lacking enthusiasm for another kind of format and another mismatch:)

  2. I just plugged Castor into my web app at work.
    Just generated the Java classes from my XML Schema using Castor XML and I am using it with no problems.
    Very quick and easy. Obviously if the schema changes I need to regenerate the Java source, but that is to be expected.

  3. I have used Digester and Castor. Neither of them give you absolute flexibility, so I endup in customized versions for each of those, because I had an object model already (ugly one, but it wasn’t designed by me).

    Anyway, note, that Digester have nothing todo with the serialization to XML but it does exellent job for parsing.

    Speaking about other alternatives, you should teke a look at JAXB from Sun http://www-106.ibm.com/developerworks/edu/x-dw-xjaxb-i.html, the old Quick from http://jxquick.sourceforge.net/quick3/ , JSX from http://www.csse.monash.edu.au/~bren/JSX/ and at least to the performance leader (according to Dennis M. Sosnoski) JiBX at http://www-106.ibm.com/developerworks/java/library/x-databd4/index.html

  4. I’ve used Digester. Like euxx said; it’s useful for reconstituting objects. I used it mainly for XML based configuration files.

  5. I have used Castor XML too, and it needs no mapping file. Just throw your XSD at it, and it generates Java classes for you. Simple to use too. I was tempted to use JAXB for a while, but at that time it could only handle DTDs, and even now it seems a bit imature. Much much simpler than DOM or SAX. I’ll never use them again, if I can ever help it.

  6. jibx.sf.net

    This is not quite there, but looks to be *very* promising. Small footprint and very performant. It essentially compiles the binding in a post-compilation step to avoid xml configuration files and using reflection (minor overhead I agree).

    But it’s not really mature enough yet (beta1). I think the developer is a little swamped, perhaps some community interest and help would get him excited!

  7. I am using Castor XML and Castor JDO in a big way.Castor XML is cool.

    Start with XSD convert to Bean (ActionForm) for struts . use XSLT to show the View cool way of doing things. Doing just that.

    Since , we are using a DOM object for XSL DOMIfication is quite fast.

  8. He he. It seems that I’ve outlined pretty much everything.

    The only problem with Castor is that it is actually slow. I’ve seen a complains from Roller Blogger developers that Castor JDO is muchs slover than Hibernate. In my personal experience if you needed to reconstruct a huge objects – don’t do it with Castor. For me it generated about 4000 classes for XSD with 1500 elements. So, I’ve choosed a different aproach.

  9. you may also want to check out vtd-xml, the latest and most advanced xml processing model

    vtd-xml

    There is a schemaless data binding approach

    google: “schemaless data binding with vtd-xml”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s