混合コンテンツを含むかまたは要素だけを含む複合型に対する拡張または制限を含めます。
<complexContent
id = ID
mixed = Boolean
{any attributes with non-schema Namespace}...>
Content: (annotation?, (restriction | extension))
</complexContent>
属性
id
この要素の ID。id の値は ID 型である必要があり、この要素を含んでいるドキュメント内で一意である必要があります。省略可能です。
mixed
この complexType 要素の子要素間に文字データを挿入できるかどうかを示すインジケータ。既定値は false です。この mixed 属性は、コンテナ complexType 要素に指定されている mixed 属性をオーバーライドします。
省略可能です。
要素情報
出現回数 |
1 回 |
親要素 |
|
コンテンツ |
オプション。annotation 必ず指定します。restriction (complexContent) または extension (complexContent) のどちらか 1 つのみを指定します。 |
例
2 つの追加要素 (state
と zipcode
) を含む継承型を拡張して、他の複合型 address
から派生させた複合型 USAddress
を定義する例を次に示します。
<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>
その他のリソース
詳細については、www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-all で公開されている、W3C 勧告『XML Schema Part 1: Structures』を参照してください。