Edit online

xs:complexType

Figure 1. The xs:complexType Component

Defines a top-level complex type. Complex Type Definitions provide for: See more data at http://www.w3.org/TR/xmlschema11-1/#element-complexType.

  • Constraining element information items by providing Attribute Declarations governing the appearance and content of attributes.
  • Constraining element information item children to be empty, or to conform to a specified element-only or mixed content model, or else constraining the character information item children to conform to a specified simple type definition.
  • Using the mechanisms of Type Definition Hierarchy to derive a complex type from another simple or complex type.
  • Specifying post-schema-validation infoset contributions for elements.
  • Limiting the ability to derive additional types from a given complex type.
  • Controlling the permission to substitute, in an instance, elements of a derived type for elements declared in a content model to be of a given complex type.
Tip: A complex type that is a base type to another type will be rendered with yellow background.
Table 1. xs:complexType Properties
Property Name Description Possible Values Mentions
Name The name of the complex type (always required) Any NCName Only for global complex types. If missing, will be displayed as '[complexType]' in diagram.
Base Type Definition The name of the extended/restricted types Any from the declared simple or complex types For complex types with simple or complex content
Derivation Method The derivation method restriction/ extension Only when base type is set. If the base type is a simple type, the derivation method is always extension.
Content The content of the complex type simple/ complex For complex types that extend/restrict a base type. It is automatically detected.
Content Mixed Specifies if the complex content model will be mixed true/false For complex contents
Mixed Specifies if the complex type content model will be mixed true/false For global and anonymous complex types
Abstract When set to true, this complex type cannot be used directly in the instance documents and needs to be substituted using an xsi:type attribute true/false For global and anonymous complex types
Block Controls if a substitution (either through a xsi:type or substitution groups) can be performed for a complex type, which is an extension or a restriction of the current complex type. This attribute can only block such substitutions (it cannot "unblock" them), which can also be blocked in the element definition. The default value is defined by the blockDefault attribute of xs:schema. all, extension, restriction, extension restriction, [Empty] For global complex types
Final Controls whether the complex type can be further derived by extension or restriction to create new complex types all, extension, restriction, extension restriction, [Empty] For global complex types
Default Attributes Apply The schema element can carry a defaultAttributes attribute, which identifies an attribute group. Each complexType defined in the schema document then automatically includes that attribute group, unless this is overridden by the defaultAttributesApply attribute on the complexType element. true/false This property is available only for XML Schema 1.1
ID The component ID Any ID For all complex types
Component The edited component name Not editable property For all complex types
Namespace The component namespace Not editable property For all complex types
System ID The component system ID Not editable property For all complex types