• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java -> XML Binding Tool

 
Richard Butterwood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone recommend a tool to convert XML into POJO'S? I am currently researching http://jibx.sourceforge.net/. Any other suggestions?

Thank you.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache's XMLBeans creates POJOs (beans) that are actually facade objects, backed by the
XML DOM tree. This means that bean.setName("Jeff") updates the backing DOM.
I don't know if this is what you are looking for, but I've been using XMLBeans
extensively on one of my current projects and it was just what I was looking for.
[ November 10, 2005: Message edited by: Jeff Albrechtsen ]
 
Richard Butterwood
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff, thanks for your reply.

All I need to do convert the XML files into POJO's. These POJO will be serialized and transmitted to another application. Is XML Beans too heavy to do something as lightweight as this?
 
Paul Clapham
Sheriff
Pie
Posts: 20719
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most of the products I've seen for Java-XML mapping require you to produce a schema for the XML you plan to make into Java objects, or something equivalent. So if you didn't have arbitrary XML documents in mind, maybe one of those products would work for you.

I was going to suggest that the standard Java object which you can convert XML into is an org.w3c.dom.Document object, but that doesn't have to be Serializable so it might not work. But if you're going to send it to another application, why not just send the XML document itself and let the other application parse it?
 
Tony OHagan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is what you're after:

https://bindmark.dev.java.net/description.html

Cheers,
Tony.
 
david lightman
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
will this xmlbeans also be good to transform a DTO or pojo, into XML?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option might Jakarta Commons Digester.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic