XMLスキーマsimpleContent要素
❮完全なXMLスキーマリファレンス
定義と使用法
simpleContent要素には、テキストのみの複合型またはコンテンツとしての単純型に対する拡張または制限が含まれ、要素は含まれません。
要素情報
- 親要素: complexType
構文
<simpleContent
id=ID
any attributes
>
(annotation?,(restriction|extension))
</simpleContent>
(?記号は、要素がsimpleContent要素内で0回または1回発生する可能性があることを宣言します)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
例1
テキストのみを含むXML要素(<shoesize>)の例を次に示します。
<shoesize country="france">35</shoesize>
次の例では、complexType、 "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>
❮完全なXMLスキーマリファレンス