Name
xs:complexContent — Definition of a complex content by derivation of a complex type.
Synopsis
<xs:complexContent id = xs:ID mixed = xs:boolean {any attributes with non-schema namespace} > Content: ((xs:annotation?), (xs:restriction | xs:extension)) </xs:complexContent>
May be included in: xs:complexType (local definition), xs:complexType (global definition)
Description
This element allows you to define a complex content model by derivation of a complex type. It is not a component by itself (complex contents are not named), but rather the declaration of an intention to define a complex content model by derivation.
The derivation method is not defined by the
xs:complexContent
element itself, but by the
choice of its child element (xs:restriction
for a
derivation by restriction, or xs:extension
for a
derivation by extension).
This element can be used to define if the content model is mixed or
not—but this information can also be defined in the
xs:complexType
parent element, which has also a
mixed
attribute.
The mixed nature of the content model defined by
xs:complexContent
attribute is dependent on the
derivation method and on the base type. If the base type is mixed, it
can be restricted to become elements only; otherwise the mixed nature
of the base type cannot be changed.
Restrictions
A base type whose elements cannot be extended to be mixed.
Example
<xs:element name="author"> <xs:complexType> <xs:complexContent> <xs:extension base="basePerson"> <xs:sequence> <xs:element ref="dead" ...
Get XML Schema now with O’Reilly online learning.
O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.