corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

XML Schema Tools: Opening a Sample XML Schema

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:

  1. In the IDE, choose File > New Project.
  2. In the Categories list, select the General node.
  3. In the Projects list, select Java Application and click Next.
  4. In the Name and Location page, in the Project Name field, enter mySchemaPrj and specify the project location.
  5. 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:

  1. In the Projects window, if the mySchemaPrj project node is not expanded, expand it now.
  2. 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.
  3. In the Categories list, expand the XML node and select the Sample Schemas node.
  4. In the File Types list, select Loan Application Schema and click Next.
  5. 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


Bookmark this page

del.icio.us furl simpy slashdot technorati digg