<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!-- schema -->
</xsd:schema><xsd:annotation>
<xsd:appinfo>
<!-- Any number of ... -->
Application information, verbal
</xsd:appinfo>
<xsd:documentation>
<!-- Any number of ... -->
Documentation
</xsd:documentation>
<para>
<!-- Any element not in xsd: -->
Grammer for a booklist
</para>
</xsd:annotation> <xsd:element name="booksCanon" type="bookListType"/>
Type in this case is home made, but could otherwise be any xsd defined type
string, normalizedStringBoolean, unsignedByte, hexBinary, …integer, int, unsignedInt, positiveInteger, …decimal, double, floattime, date, dateTime, duration, …Simple type to be used several times in schema
<xsd:simpleType name="currency">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="US$"/>
<!-- a number of possible values -->
</xsd:restriction>
</xsd:/simpleType>
Complex because it may contain elements. Please notice the way elements are defined.
<xsd:complexType name="booklistType">
<xsd:sequence>
<xsd:element name="book" type="bookType" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:/complexType>
Complex because it may contain elements. Please notice, again, element definitions, and attribute ditto. Attributes may be grouped and referenced as a group.
<xsd:complexType name="bookType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string"/>
<!-- a number of elements to form the sequence -->
</xsd:sequence>
<xsd:attribute name="ref" type="xsd:string"/>
<!-- a number of attributes -->
</xsd:/complexType>