Contains extensions or restrictions on a complex type that contains mixed content or elements only.
<complexContent id = ID mixed = Boolean {any attributes with non-schema Namespace}…> Content: (annotation?, (restriction | extension)) </complexContent>
Optional.
This mixed attribute can override the mixed attribute value specified on the containing complexType element.
Optional.
Number of occurrences | One time |
Parent elements | complexType |
Contents | Optional. annotation
Required. One and only one of the following elements: restriction (complexContent), or extension (complexContent). |
The following example has a complex type, USAddress
, that derives from another complex type, address
, by extending the inherited type with two additional elements (state
and zipcode
).
<xs:complexType name="address"> <xs:sequence> <xs:element name="name" type="xs:string"/> <xs:element name="street" type="xs:string"/> <xs:element name="city" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:complexType name="USAddress"> <xs:complexContent> <xs:extension base="address"> <xs:sequence> <xs:element name="state" type="USState"/> <xs:element name="zipcode" type="xs:positiveInteger"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
XML Schema Reference (XSD) | XML Schema Elements
For more information, see the W3C XML Schema Part 1: Structures Recommendation at http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-complexContent.