The main steps involved in the creation of a schema are as follows:
The creation of an XML prolog and schema element : During this process the user would define the information about the xml document and can contain annotataions for another uer or application to know more about the schema.
Adding namespace : Once the prolog and the schema element is defined the user can define the xmlns attribute to the schema.
For Example:
<?xml version=”1.0” encoding=”UTF-8”?>
<xsd:schema xmlns:xsd=”http://www.abc.org/2001/XMLSchema”>
Addition of all the element and attribute declarations created by the user. A snippet of the declarations is given below:
<xsd:complexType name=”bookType”>
<xsd:sequence>
<xsd:element ref=”title”/>
<xsd:element ref=”author”/>
<xsd:element ref=”publisher”/>
<xsd:element ref=”price”/>
<xsd:element ref=”isbn”/>
</xsd:sequence>
Saving the schema : once the user has entered all the declarations in the file the file can be saved using the .xsd extension.