最新のWeb開発のチュートリアル
 

XMLスキーマattributeGroupの要素


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

定義と使用法

それらは複合型定義にグループとして組み込むことができるようにattributeGroupの要素グループに属性宣言のセットが使用されます。

要素情報

  • Parent elements: attributeGroupの、complexTypeに、スキーマ、制限(simpleContentにとcomplexContentを両方)、拡張子(both simpleContent and complexContent)

構文

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

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

</attributeGroup>

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

属性 説明
id 任意。 要素の一意のIDを指定します。
name 任意。 属性グループの名前を指定します。 名前とref属性が両方存在することはできません
ref 任意。 名前の属性グループへの参照を指定します。 名前とref属性が両方存在することはできません
any attributes 任意。 非スキーマの名前空間を持つ任意の他の属性を指定します。

例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"という名前の複合型で使用されている"person"


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