Generating Java Classes from XML Schema Documents

See Also 

You can use the JAXB Wizard to generate Java classes from an XML schema file. Once you have the classes, you can use them in a variety of scenarios to traverse the elements and attributes of the XML schema file.

To generate Java classes from an XML schema document:

  1. Make sure that you have installed the full distribution of the IDE, since the JAXB Wizard is only provided with the full distribution.
  2. Create a project type to store the code that you will generate from the XML file. The JAXB Wizard can be used with the 'Java Application', 'Java Class Library', 'Web Application' and 'EJB Module' project types.
  3. In the Projects window or Files window, right-click the project node and choose New > Other. In the New File wizard, choose JAXB Binding from the XML category. Click Next.

    In the wizard, fill in the fields as described below:

  4. Click Finish.
  5. Open the Files window, and notice that the Java classes have been generated in the build folder.
See Also
About Mapping XML to Java
Marshalling and Unmarshalling Java to XML

Legal Notices