Compiling an XML schema
In this section, we shall compile the example XML schema using the JAXB compiler in JDeveloper 11g. To compile the example XML schema, select the schema node in Application Navigator and select File|New. In the New Gallery window select Categories|Business Tier|TopLink/JPA and Items|JAXB 2.0 Content Model from XML Schema, and click on OK.
In the JAXB 2.0 Content Model from XML Schema window select the Schema File as catalog.xsd
, if not already selected. Select the Output Source Directory as src (the default). Specify Package Name for Generated Classes as jaxb and click on OK.
The schema gets compiled and the Java classes get generated in the specified package. A Java class gets generated for each of the complexType
definitions. The value class CatalogType.java
gets generated for complexType catalogType. CatalogType.java
consists of accessor methods for the journal, title
, and publisher
properties and is listed as follows:
package jaxb; import java.util.ArrayList...