users@jaxb.java.net

Re: Converting XML to Java Objects...possible?

From: Raymond Wold <raymond.wold_at_teletopia.com>
Date: Wed, 11 Apr 2007 16:55:17 +0200

tweety123 wrote:
> Hi all, Thanks for your replies.
>
> How do I actually convert XML to Java object (not class)? I know that to
> convert XML to java classes (not objects), I need to use
> Marshaller.unmarshal(). How do I convert the XML to java "object" (& not
> "class")?
>
> Thanks.

You are mistaken. The method 'unmarshal' creates objects, not classes. The
binding compiler 'xjc' creates classes, not objects. You use a marshaller to
get XML from objects, and an unmarshaller to get objects from XML.

See the image at http://java.sun.com/developer/technicalArticles/WebServices/jaxb/