What is an XML schema?
An XML Schema acts as a template for XML data. A Schema is used to define the basic structure of an XML document, so that a group of related items will share a common format. This is important because it is much easier to process XML data which is in a consistent, predictable format. Schemas contain a combination of elements, each of which stores a single data type. Because of the flexibility of XML, an element can store anything from a simple name or phone number to a full-fledged annual report.
An XML schema defines the structure of XML documents. They define what XML elements can be used in a document and how. They also specify the data type and number of occurrences for each XML element. For example, the NSDL_DC XML schema defines an element called dc:title that may or may not appear in the document but if it does, the content is text. Because XML schemas define the structure of XML elements in a document, this ‘instance’ document can be validated by machines to see if it is correctly structured and using the correct data types. For more information, see http://www.w3.org/XML/Schema, and in particular the XML schema primer: http://www.w3.org/TR/xmlschema-0/.