एक्सएमएल स्कीमा विशेषता समूह तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
विशेषता समूह तत्व का उपयोग विशेषता घोषणाओं के समूह को समूहित करने के लिए किया जाता है ताकि उन्हें समूह के रूप में जटिल प्रकार परिभाषाओं में शामिल किया जा सके।
तत्व जानकारी
- मूल तत्व: विशेषता समूह, जटिल प्रकार, स्कीमा, प्रतिबंध (सरल सामग्री और जटिल सामग्री दोनों), विस्तार (सरल सामग्री और जटिल सामग्री दोनों)
वाक्य - विन्यास
<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>
उपरोक्त उदाहरण "व्यक्तित्व" नामक एक विशेषता समूह को परिभाषित करता है जिसका उपयोग "व्यक्ति" नामक जटिल प्रकार में किया जाता है।
❮ पूर्ण XML स्कीमा संदर्भ