Latest web development tutorials

XMLスキーマsimpleContentを要素

XMLスキーマリファレンス 完全なXMLスキーマリファレンス

定義と使用法

simpleContentを要素がcomplexType要素(それsimpleType要素または文字データ内容)が延長または制限され、任意の要素が含まれていませんが含まれています。

要素情報

  • 親エレメント:complexTypeの

文法

<simpleContent
id=ID
any attributes
>

(annotation?,(restriction|extension))

</simpleContent>

(?サイン要素simpleContentを要素が0回または1回発生する可能性があることを宣言します。)

属性 描述
id 可选。规定该元素的唯一的 ID。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

例1

これは、テキストのみを含むXML要素である(<SHOESIZE>):

<shoesize country="france">35</shoesize>

次の例は、その内容が整数データ型、および属性を持つ国として定義されている複合型 "SHOESIZE」を、宣言します。

<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スキーマリファレンス 完全なXMLスキーマリファレンス