elemen XML Schema attributeGroup
Definisi dan Penggunaan
Unsur attributeGroup digunakan untuk menyatakan atribut digabungkan, sehingga laporan ini dapat dikombinasikan untuk membentuk menjadi tipe kompleks.
Informasi elemen
- elemen induk: attributeGroup, complexType, skema, pembatasan (baik simpleContent dan complexContent), ekstensi (baik simpleContent dan complexContent)
tatabahasa
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(? Masuk menyatakan unsur attributeGroup, elemen dapat terjadi nol atau satu waktu, * tanda menyatakan bahwa elemen dapat terjadi nol atau lebih kali.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
name | 可选。规定属性组的名称。name 和 ref 属性不能同时出现。 |
ref | 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
contoh 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>
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
Contoh di atas mendefinisikan sebuah kelompok properti bernama "personattr" menggunakan tipe kompleks bernama "orang" di.
Lengkap XML Schema Referensi