XML Schema attributeGroup element
ການກໍານົດ ແລະ ການນໍາໃຊ້
ປະກອບສັນຍານ attributeGroup ຖືກນຳໃຊ້ເພື່ອປະສົມລັກສະນະ, ເຊິ່ງພວກມັນສາມາດຖືກປະສົມກັນໃນຮູບແບບຂອງຮູບແບບກະຈັດການ.
ຂໍ້ມູນປະກອບສັນຍານ
ຈຳການອອກມາ | ບໍ່ມີຂໍ້ຈຳກັດ |
ປະກອບສັນຍານພໍ່ | attributeGroup、complexType、schema、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent) |
ຂໍ້ມູນ | annotation、attribute、attributeGroup、anyAttribute |
ວິທີການ
<attributeGroup id=ID name=NCName ref=QName any attributes > (annotation?),((attribute|attributeGroup)*,anyAttribute?)) </attributeGroup>
(? ສະແສງອອກໃນປະກອບສັນຍານ attributeGroup, ປະກອບສັນຍານອາດອອກມາບໍ່ມີຫຼືຫຼຽນຫຼັງ. * ສະແສງອອກໃນປະກອບສັນຍານອາດອອກມາບໍ່ມີຫຼືຫຼຽນຫຼັງ.)
ລັກສະນະ | ການອະທິບາຍ |
---|---|
id | ຄວາມຄິດດັ່ງກ່າວ. ພົບກັບ ID ສະນະພາບຂອງປະກອບສັນຍານດຽວ. |
name | ຄວາມຄິດດັ່ງກ່າວ. ພົບກັບຊື່ຂອງກຸ່ມລັກສະນະ. name ແລະ ref ບໍ່ຄວນຈະອອກມາພ້ອມກັນ. |
ref | ຄວາມຄິດດັ່ງກ່າວ. ພົບກັບການອ້າງອິດທິພົນບັນດາລັກສະນະຂອງກຸ່ມ. name ແລະ ref ບໍ່ຄວນຈະອອກມາພ້ອມກັນ. |
any attributes | ຄວາມຄິດດັ່ງກ່າວ. ພົບກັບບັນດາລັກສະນະບໍ່ແບບສານງານ. |
ຄວາມສະເພາະ
<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" 的复杂类型中使用。