jQuery in Action, 3rd edition
The moose likes XML and Related Technologies and the fly likes XML directly to java classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML directly to java classes" Watch "XML directly to java classes" New topic

XML directly to java classes

Petr Blahos
Ranch Hand

Joined: Apr 28, 2004
Posts: 131
Hi all,

I was wondering if there is a library that will allow me read
xml directly into a structure of Java classes. Example:
Let's have an xml:

And java classes:

This library would read the xml and build the corresponding
structure of classes. Any hints?

Thanks, Petr

Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Take a look at XStream.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Daniel Mayer
Ranch Hand

Joined: Sep 09, 2004
Posts: 103
Alternatives are http://www.castor.org/ and http://jakarta.apache.org/commons/digester/
I agree. Here's the link: http://aspose.com/file-tools
subject: XML directly to java classes
It's not a secret anymore!