XML Schema Tools: Opening a Sample XML Schema
Last Updated: 19 October 2006
Back to Getting Started With XML Schema Tools
The goal of this tutorial is to create a Java Application project and then add a sample XML schema to that project. You can add XML schema files to any project type in the IDE, except UML projects.
Note: Wherever you see the
icon, you can click to view a detailed interactive demonstration of the steps described in the tutorial.
top
Creating a Java Application Project
In this tutorial, you will use a Java Application project called mySchemaPrj as a container for the XML schema.
To create a new mySchemaPrj project:
- In the IDE, choose File > New Project.
- In the Categories list, select the General node.
- In the Projects list, select Java Application and click Next.
- In the Name and Location page, in the Project Name field, enter mySchemaPrj and specify the project location.
- Clear the Create Main Class checkbox and click Finish.
We do not need a main class for this tutorial.
The Projects window now contains a project node labeled mySchemaPrj.
View Demo
top
Opening a Sample XML Schema
Now that you have created the mySchemaPrj project, you will add a sample XML schema to the project.
To add a sample XML schema to the mySchemaPrj project:
- In the Projects window, if the mySchemaPrj project node is not expanded, expand it now.
- Select the Source Packages node, right-click and choose New > File/Folder.
The New File wizard opens. The Project drop-down list contains the name of the project where you are adding the file, in this case, mySchemaPrj.
- In the Categories list, expand the XML node and select the Sample Schemas node.
- In the File Types list, select Loan Application Schema and click Next.
- Accept the default values in the Name and Location page of the wizard (File Name: newLoanApplication, Folder: src) and click Finish.
In the Projects window, the <default package> node under the Source Packages node now contains a subnode labeled newLoanApplication.xsd. The newly created subnode is selected and the Source Editor contains a tab for the XML schema file, newLoanApplication.xsd.
View Demo
top
Next Step
Now that you have an XML schema open in the IDE, continue with Exploring XML Schemas to explore the schema.
top