FeaturesPluginsDocs & SupportCommunityPartners

Creating a Project and 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.

top

Tutorial Requirements

Before you proceed, make sure you review the requirements in this section.

Prerequisites

The XML schema tools tutorials assume that you have some knowledge of, and experience with XML (Extensible Markup Language).

Software Needed for This Tutorial

Before you begin, you need to install the following software on your computer:

  • NetBeans 6.0. Select the Download All option. The Download All option includes SOA Pack and GlassFish V2, which are required for this tutorial.
  • Some XML schema tools tutorials use the UBL sample schema that is included in the Java Web Services Developer Pack (Java WSDP) Version 2.0.
    If you want to step through these tutorials offline, you should download Java WSDP.

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 Java 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.

    New project created

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 > Other.
    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.
  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 Source Editor contains a tab for the XML schema file, newLoanApplication.xsd.

    Sample schema added to project

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
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Virtual Box - full virtualizer  Open ESB - The Open Enterprise Service Bus Powered by