Home

 

Creating an XML schema

In this section, we create an XML schema for use in storing bank account information. The XML document structure defined in the schema is a collection of accounts. Each account has an account ID, account type, account balance, interest rate, and related customer information. The account ID is allowed to be from 6 to 8 digits long and each digit must be in the range 0 to 9. The value of the interest rate is allowed to be between 0 and 100. The phone number is in the format (xxx) xxx-xxxx. The following steps create a project to hold our schema document and create an empty schema document:

Open the Resource perspective and create a project named RAD75XMLBank:

Select File Æ New Æ Project Æ General Æ Project, then click Next.
In the Project name field type RAD75XMLBank.
Click Finish and the project is displayed in the Enterprise Explorer.
Right-click the RAD75XMLBank project and select New Æ Folder. Enter xml as folder name, and click Finish.

Create an XML schema:

Right-click the xml folder and select New Æ Other Æ XML Æ XML schema. Click Next.
The parent folder is set to RAD75XMLBank/xml. In the File name field type Accounts.xsd. Click Finish.
Make sure that the Properties view is visible. If you cannot see the Properties view, select Window Æ Show view Æ Properties.
ibm.com/redbooks