< Previous | Next >

Creating an XML schema document

Use the XSD editor to create an XML document for your XML schema. The XML document is used to define the XML schema. XML schemas must contain one or more XML schema documents.

To create an XML schema document:

  1. In the File menu, select New > Other. The New wizard opens.
  2. Expand the XML folder, and select XML Schema.
  3. Click Next. The Create XML Schema wizard opens.
  4. Select the XMLSchema project.
  5. In the File name field, type employee.xsd.
  6. Click Finish to create the XML schema. The XSD editor opens.
  7. In the XSD editor, replace any existing XML with the following XML:
    <?xml version="1.0" encoding="UTF-8"?>
    http://www.w3.org/2001/XMLSchema
    targetNamespace="http://www.ibm.com/tutorialemployee"
    elementFormDefault="qualified">
    <xs:element name="employee">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="lastName" type="xs:string"/>
    <xs:element name="firstName" type="xs:string"/>
    <xs:element name="hireDate" type="xs:date"/>
    </xs:sequence>
    <xs:attribute name="id" use="required" type="xs:integer"/>
    </xs:complexType>
    </xs:element>
    </xs:schema>
  8. In the File menu, select Save.
< Previous | Next >