The Online Encyclopedia and Dictionary






XML Schema

XML Schema, published as a W3C Recommendation in May 2001, is one of several XML schema languages. It was the first separate schema language for XML to achieve Recommendation status by the W3C.

Since other XML schema languages such as RELAX NG now exist, it is important to cite this language as either XML Schema or W3C XML Schema, always with the word Schema capitalized. An XML Schema instance is an XML Schema Definition (XSD) and typically has the filename extension ".xsd". The language itself is sometimes informally referenced as XSD, even though WXS (W3C Xml Schema) is the more appropriate initialism.

In its appendix of references, XML Schema acknowledges the influence of DTD and other early XML schema efforts such as DDML , SOX, XML-Data , and XDR . It appears to have picked pieces from each of these proposals, but is also a compromise between them. Of those languages, two are still actively used and developed: XDR and SOX. Their sponsors, Microsoft and Commerce One, respectively, have both announced that they would support XML Schema for their new developments, so W3C XML Schema should become the only surviving member of this family.

After XML Schema-based validation, it is possible to express an XML document's structure and content in terms of the data model that was implicit during validation. The XML Schema data model includes:

  • the vocabulary (Element/Attribute names)
  • the content model (Relationships/Structure)
  • and data types.

This collection of information is called the Post-Schema Validation Infoset (PSVI). This gives a valid XML document it's "Type".


An example of a very simple Schema to describe a country is given below:

 <xs:element name="country">
    <xs:element name="name" type="xs:string"/>
    <xs:element name="pop" type="xs:decimal"/>

An example of an XML document that conforms to this schema is given below.


External links

The contents of this article are licensed from under the GNU Free Documentation License. How to see transparent copy