Latest web development tutorials

XMLスキーマattributeGroupの要素

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

定義と使用法

attributeGroupの要素は、これらのステートメントは、複合型に形成することができるように、属性が組み合わされて宣言するために使用されます。

要素情報

  • 親エレメント:attributeGroupの、complexTypeに、スキーマ、制限 (simpleContentにとcomplexContentを両方)、拡張子(simpleContentにとcomplexContentを両方)

文法

<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>

(annotation?),((attribute|attributeGroup)*,anyAttribute?))

</attributeGroup>

(?サインインしてattributeGroupの要素を宣言し、要素が0回または1回発生する可能性があり、*記号は要素が0回以上発生する可能性があることを宣言します。)

属性 描述
id 可选。规定该元素的唯一的 ID。
name 可选。规定属性组的名称。name 和 ref 属性不能同时出现。
ref 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

例1

<xs:attributeGroup name="personattr">
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>

<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>

上記の例では、中に「人」という名前の複合型を使用して「personattrを」という名前のプロパティグループを定義します。


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