A schemadatabase, XML, or otherwisespecifies structure for data. For the most part, the XML Schema Recommendation provides mechanisms for validating distinct datum (via simple types) and the composite structure of data (via complex types). This article is an overview of complex types.
The subsequent sections of this document cover the four complex type variations:
Empty contentelement types that optionally specify attribute types, but do not permit content.
Simple contentadding or removing attribute types to what would otherwise be simple types.
Complex contentspecifying a complex, generally rigid, structure or hierarchy of element types, and their associated attribute types.
Mixed contentspecifying a potentially complex structure in which text might be interspersed in the corresponding XML.
This article also covers extending and restricting complex types. This functionality supports an object-oriented approach to building complex types in XML Schema.
Finally, this article covers the distinction between the frequently used shorthand notation for describing complex types, and the precise longhand notation.
Due to the complexity of creating and using complex types, some of the examples might not be entirely clear without further context. An XML schema and a corresponding XML instance contain examples that demonstrate complex types in much more detail.