एक्सएमएल स्कीमा पसंद तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
XML स्कीमा पसंद तत्व <विकल्प> घोषणा में निहित तत्वों में से केवल एक को युक्त तत्व के भीतर मौजूद होने की अनुमति देता है।
तत्व जानकारी
- मूल तत्व: समूह, पसंद, अनुक्रम, जटिल प्रकार, प्रतिबंध (सरल सामग्री और जटिल सामग्री दोनों), विस्तार (सरल सामग्री और जटिल सामग्री दोनों)
वाक्य - विन्यास
<choice
id=ID
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
any attributes
>
(annotation?,(element|group|choice|sequence|any)*)
</choice>
(? चिन्ह घोषित करता है कि तत्व शून्य या एक बार हो सकता है, और * चिह्न घोषित करता है कि तत्व पसंद तत्व के अंदर शून्य या अधिक बार हो सकता है)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the choice element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1 |
minOccurs | Optional. Specifies the minimum number of times the choice element can occur in the parent the element. The value can be any number >= 0. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
उदाहरण
<xs:element name="person">
<xs:complexType>
<xs:choice>
<xs:element name="employee" type="employee"/>
<xs:element name="member" type="member"/>
</xs:choice>
</xs:complexType>
</xs:element>
उपरोक्त उदाहरण "व्यक्ति" नामक तत्व को परिभाषित करता है जिसमें या तो "कर्मचारी" तत्व या "सदस्य" तत्व होना चाहिए।
❮ पूर्ण XML स्कीमा संदर्भ