Generating Java Classes from XML Schema
Oxygen XML Developer includes a tool for generating Java classes from an XML Schema (XSD) file. The Generate Java classes from XML Schema (XSD) action for invoking the tool can be found in the Tools menu. It requires an additional add-on to be installed, so the first time you invoke the action, Oxygen XML Developer will present a dialog box asking if you want to install it. Once installed, you need to restart Oxygen XML Developer and the action will invoke the Java class generator tool.
Quick Installation
You can drag the following Install button and drop it into the main editor in Oxygen to quickly initiate the installation process:
Manual Installation
- Go to to open an add-on selection dialog box.
- Enter or paste
https://www.oxygenxml.com/InstData/Addons/default/updateSite.xml in the
Show add-ons from field or select it from the drop-down
menu.Note: If you have issues connecting to the default update site, you can download the add-on package, unzip it, then use the Browse for local files action in the Install new add-ons dialog box to locate the downloaded addon.xml file.
- Select the Java Classes Generator add-on and click Next.
- Read the end-user license agreement. Then select the I accept all terms of the end-user license agreement option and click Finish.
- Restart the application.
Result: The Generate Java classes from XML Schema (XSD) dialog box is now available and can be selected from the Tools menu.
Generating Java Classes
To generate Java classes, follow these steps:
-
Select the Generate Java classes from XML Schema (XSD) action from the Tools menu.
Step Result: The Generate Java classes from XML Schema (XSD) dialog box is displayed:
- Choose or enter the XSD URL of the XML Schema document.
- Choose the path for the Output folder where the generated files will be stored.
- [Optional] You can choose the Package name
for the Java package that will contain the generated source files. If not specified, the
name will be generated based on the value of the
@targetNamespace
attribute. - [Optional] You can select the Open in Editor option to open the ObjectFactory.java file in the editor. This java class contains factory methods for all other classes in the package.
- Click the Generate button.
Result: The Java class files will be generated inside the new package, located in the specified output folder.