عنصر مجموعة سمات مخطط XML
❮ مرجع مخطط XML الكامل
التعريف والاستخدام
يتم استخدام عنصر attributeGroup لتجميع مجموعة من إعلانات السمات بحيث يمكن دمجها كمجموعة في تعريفات الأنواع المعقدة.
معلومات العنصر
- العناصر الأصلية: attributeGroup ، و complexType ، و schema ، و Restorion (simpleContent and complexContent) ، و extension (simpleContent و complexContent)
بناء الجملة
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(تعلن العلامة أن العنصر يمكن أن يحدث صفرًا أو مرة واحدة ، وتعلن العلامة * أن العنصر يمكن أن يحدث صفرًا أو أكثر من المرات داخل عنصر مجموعة السمة)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Optional. Specifies the name of the attribute group. Name and ref attributes cannot both be present |
ref | Optional. Specifies a reference to a named attribute group. Name and ref attributes cannot both be present |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
مثال 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 الكامل