एक्सएमएल स्कीमा सरल प्रकार तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
simpleType तत्व एक साधारण प्रकार को परिभाषित करता है और विशेषताओं या केवल-पाठ तत्वों के मूल्यों के बारे में बाधाओं और जानकारी को निर्दिष्ट करता है।
तत्व जानकारी
- मूल तत्व: विशेषता, तत्व, सूची, प्रतिबंध, स्कीमा, संघ
वाक्य - विन्यास
<simpleType
id=ID
name=NCName
any attributes
>
(annotation?,(restriction|list|union))
</simpleType>
(? चिन्ह यह घोषित करता है कि तत्व सरल प्रकार के तत्व के अंदर शून्य या एक बार हो सकता है)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Specifies a name for the element. This attribute is required if the simpleType element is a child of the schema element, otherwise it is not allowed |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
उदाहरण 1
यह उदाहरण "आयु" नामक एक तत्व को परिभाषित करता है जो एक प्रतिबंध के साथ एक साधारण प्रकार है। आयु का मान 0 से कम या 100 से अधिक नहीं हो सकता:
<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
❮ पूर्ण XML स्कीमा संदर्भ