XML Schema Tutorial



XML Schema Introduction


An XML Schema defines the structure of XML documents and is used to validate the document's format.


XML Schema is a kind of an XML document.


The XML Schema file extension is '.xsd'.


XML Schema describes a document structure, data types, and restrictions.



<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="item">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="id" type="xs:integer"/>
<xs:element name="type" type="xs:string"/>
<xs:element name="power" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>