Introduction to XML Schema
XML Schema is an XML-based replacement for DTD.
XML Schema can describe the structure of an XML document.
The XML Schema language can also be referred to as XSD (XML Schema Definition).
Prerequisites
Before continuing, you need a basic understanding of the following:
- HTML / XHTML
- XML and XML Namespaces
- Basic Knowledge of DTD
If you want to learn these topics first, please Home to access these tutorials.
What is XML Schema?
The role of XML Schema is to define the legal building blocks of an XML document, similar to a DTD.
XML Schema:
- Define the elements that can appear in a document
- Define the attributes that can appear in a document
- Define which elements are child elements
- Define the order of child elements
- Define the number of child elements
- Define whether an element is empty or can contain text
- Define the data types of elements and attributes
- Define the default and fixed values of elements and attributes
XML Schema is the Successor to DTD
We believe that XML Schema will soon replace DTD in most web applications.
The reasons are as follows:
- XML Schema can be extended to meet future requirements
- XML Schema is more complete and more powerful
- XML Schema is written based on XML
- XML Schema supports data types
- XML Schema supports namespaces
XML Schema is a W3C standard
XML Schema became a W3C standard on May 2, 2001.
You can read more about XML standards in ourW3C Tutorial》 for more information about the XML Schema standard.