An XML schema describes the “type” of an XML document, typically expressed in terms of constraints on the structure and content of XML documents of that type. These constraints or rules are defined above and beyond the basic syntax rules which qualify a document as being an XML document.
As an analogy in Object-Oriented Programming, think of an XML schema as a “class” and XML documents conforming to the schema as “instances” or “objects” of that class.
Several languages have been developed specifically to express XML schemas. “Validating Parsers” are used to validate the conformance of XML documents to XML schemas. The most common type are “DTD-Validating Parsers”, which support the Document Type Definition (DTD) language. DTD is a schema language of relatively limited capability, native to the XML specification.
Finally, Schemas can be programatically generated from XML Documents, with a little patience.
- DTD at Wikipedia
- RELAX NG at Wikipedia
- RELAX NG Home Page
- Schematron at Wikipedia
- ISO Schematron Home Page
- Designing a New Schema with XML Design Pattterns
- W3C XML Schema Requirements