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:
- In the File menu, select . The New wizard
opens.
- Expand the XML folder, and select XML
Schema.
- Click Next. The Create
XML Schema wizard opens.
- Select the XMLSchema project.
- In the File name field, type employee.xsd.
- Click Finish to create the XML schema. The XSD editor opens.
- 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>
- In the File menu, select Save.