XML Schema is an XML based alternative to DTD.
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 study the XML Schema Language, you should have a basic understanding
of XML and XML Namespaces. It will also help to have some basic understanding
of DTD.
If you want to study these subjects first, please visit our
XML tutorial and our DTD tutorial.
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 useful 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 was originally proposed by Microsoft, but became an official W3C
recommendation in May 2001.
The specification is now stable and has been reviewed by the W3C Membership.
For a full overview of W3C Activities and Status, visit
our W3C tutorial.
|