Introduction to XML Schema
An XML schema describes the structure of an XML document.
The XML Schema language is also referred to as XML Schema Definition (XSD).
What You Should Already Know
Before you continue you should have a basic understanding of the following:
- HTML / XHTML
- XML and XML Namespaces
- A basic understanding of DTD
If you want to study these subjects first, find the tutorials on our Home page.
What is an XML Schema?
The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.
An XML Schema:
- defines elements that can appear in a document
- defines attributes that can appear in a document
- defines which elements are child elements
- defines the order of child elements
- defines the number of child elements
- defines whether an element is empty or can include text
- defines data types for elements and attributes
- defines default and fixed values for elements and attributes
XML Schemas are the Successors of DTDs
We think that very soon XML Schemas will be used in most Web applications as a replacement for DTDs. Here are some reasons:
- XML Schemas are extensible to future additions
- XML Schemas are richer and more powerful than DTDs
- XML Schemas are written in XML
- XML Schemas support data types
- XML Schemas support namespaces
XML Schema is a W3C Recommendation
XML Schema became a W3C Recommendation 02. May 2001.
You can read more about the XML Schema standard in our W3C tutorial.