XML Schema
lastmod 2024-11-08created 2021-01-239 edits
XML Schema is one of several XML schema languages, published as a W3C standard in May 2001. It was the first separate schema language for XML to achieve W3C Recommendation status. Because its name is easily confused with XML schemas in general and with what the W3C specifically defined, some parts of the user community call this language WXS, an initialism for W3C XML Schema. Others use XSD, short for XML Schema Definition. In version 1.1, the W3C adopted XSD as the preferred name, and this page also calls it XSD.
Like all other XML schema languages, XSD is used to express a set of rules that an XML document must conform to in order to be considered 'valid' according to that schema. However, unlike most other schema languages, XSD was designed with the intent that validating a document would produce a collection of information bound to specific datatypes.
Categories
Datatypes
Built-in datatypes
XML_Schema_Part_2_Built-in_datatypes.png
Primitive datatypes
- string
- boolean
- decimal
- float
- double
- duration
- dateTime
- time
- date
- gYearMonth
- gYear
- gMonthDay
- gDay
- gMonth
- hexBinary
- base64Binary
- anyURI
- QName
- NOTATION
XSD simple types (simpleType)
Simple type elements
XSD attributes
XSD restrictions
XSD complex types (complexType)
Complex type elements
Order indicators
Occurrence indicators
Occurrence indicators are used to define how many times an element can occur as a child element.
For all order indicators and group indicators, the default value of the occurrence indicators is 1.
- maxOccurs
- minOccurs