The Purpose of XML Schema
XML provides a grammar for parsing a particular file or stream format. This XML grammar covers basic syntax, the most interesting being that of element tags and attribute specifications. Most applications need far more structure. XML Schemas provide a mechanism for specifying more extensive grammar constraints. The ability to guide the layout of an XML document makes that XML document much more predictable. A programmer can examine an XML schema and know exactly what corresponding XML documents look like. Additionally, a program can reject an XML document out of hand when the XML does not conform to the appropriate XML schemaAn XML schema specifies valid elements and attributes in an XML instance. Furthermore, a schema specifies the exact element hierarchy for nested elements. A schema specifies options such as limits on the number of occurrences of a type of element and various other constraints placed on the XML instance. In addition, a schema specifies a range for the value of an element or attribute
