एक्सएमएल स्कीमा संघ तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
संघ तत्व एक साधारण प्रकार को निर्दिष्ट सरल डेटा प्रकारों से मूल्यों के संग्रह (संघ) के रूप में परिभाषित करता है।
तत्व जानकारी
- मूल तत्व: सरल प्रकार
वाक्य - विन्यास
<union
id=ID
memberTypes="list of QNames"
any attributes
>
(annotation?,(simpleType*))
</union>
(? चिन्ह घोषित करता है कि तत्व संघ तत्व के अंदर शून्य या एक बार हो सकता है)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
memberTypes | Optional. Specifies a list of built-in data types or simpleType elements defined in a schema |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
उदाहरण 1
यह उदाहरण एक साधारण प्रकार दिखाता है जो दो सरल प्रकारों का मिलन है:
<xs:element name="jeans_size">
<xs:simpleType>
<xs:union memberTypes="sizebyno sizebystring" />
</xs:simpleType>
</xs:element>
<xs:simpleType name="sizebyno">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="42"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sizebystring">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
❮ पूर्ण XML स्कीमा संदर्भ