I’m a total newbie with XML. I’m doing a Java EE project REST implementation and we return a lot of XML. With this we decided to use JAXB. So far, we manually coded the Models for the XML.
But there are already these complex structures we don’t know how to code. We’ve read about generating classes from XSD. We do have an XSD.
My questions:
1.) I’ve read about XJC, where can I find it?
2.) Do we have to install the whole JAXB? (so what we used so far? isn’t this JAXB?)
XJC is included in the bin directory in the JDK starting with Java SE 6. For an example see:
The contents of the blog are the following:
Processing Atom Feeds with JAXB
Atom is an XML format for representing web feeds. A standard format allows reader applications to display feeds from different sources. In this example we will process the Atom feed for this blog.
Demo
In this example we will use JAXB to convert the Atom XML feed corresponding to this blog to objects and then back to XML.
JAXB Model
The following model was generated by the schema to Java compiler (XJC). I have omitted the get/set methods and comments to save space.
package-info
CategoryType
Content Type
DateTimeType
EntryType
FeedType
GeneratorType
IconType
IdType
LinkType
LogoType
PersonType
SourceType
TextType
UriType