XML Schema simpleContent要素
完全な XML Schema リファレンスマニュアル
定義と使い方
simpleContent 要素は、complexType 要素(文字データまたは simpleType 要素を内容とする)の拡張または制限を含み、いかなる要素も含みません。
要素情報
- 親要素: complexType
構文
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(? 記号は、その要素が simpleContent 要素内で 0 回または 1 回出現できることを宣言します。)
| 属性 | 説明 |
|---|---|
| id | 任意。この要素の一意の ID を規定します。 |
| any attributes | 任意。non-schema 名前空間を持つその他の属性を規定します。 |
例 1
これはテキストのみを含む XML 要素 (<shoesize>) です:
以下の例では、複合型 "shoesize" を宣言しています。その内容は整数データ型として定義され、country 属性を持ちます。
<xs:element name="shoesize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
完全な XML Schema リファレンスマニュアル その他の拡張