From EduTechWiki - Reading time: 2 min
“XML Schema: Structures specifies the XML Schema definition language, which offers facilities for describing the structure and constraining the contents of XML 1.0 documents, including those which exploit the XML namespace facility. The schema language, which is itself represented in XML 1.0 and uses namespaces, substantially reconstructs and considerably extends the capabilities found in XML 1.0 document type definitions (DTDs).”(XML Schema Part 1: Structures Second Edition)
“An XML Schema consists of components such as type definitions and element declarations. These can be used to assess the validity of well-formed element and attribute information items (as defined in [XML-Infoset]), and furthermore may specify augmentations to those items and their descendants.”(XML Schema Part 1: Structures Second Edition)
XML Schema is considerably more complex, and provide a finer level of control, than the Document Type Definition (DTD) and less elegant than Relax NG
See also: XML Schema tutorial - Basics
The main ingredients of an XML Schema are elements, types and attributes.
Elements : are declared with the <xsd:element> tag. They can have element-only, mixed, or empty of elements content. Elements can also be restricted to have certain values, i.e. types like:
Simple types can be combined into more complex types. A complex type can define elements, attributes or data types.
Complex elements are firstly used to define element order, e.g. :
Attributes are also defined within complex elements: any of the simple types can be used as attribute. The attribute can be optional, required or prohibited.
Read more in XML Schema tutorial - Basics
Certain educational modeling languages use XML Schema, e.g.
W3C XML Schema 1.0 Specification
W3C XML Schema 1.1 Specification