एक्सएमएल स्कीमा अनुक्रम तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
अनुक्रम तत्व निर्दिष्ट करता है कि बाल तत्वों को अनुक्रम में प्रकट होना चाहिए। प्रत्येक चाइल्ड एलिमेंट 0 से लेकर कितनी भी बार तक हो सकता है।
तत्व जानकारी
- मूल तत्व: समूह, पसंद, अनुक्रम, जटिल प्रकार, प्रतिबंध (सरल सामग्री और जटिल सामग्री दोनों), विस्तार (सरल सामग्री और जटिल सामग्री दोनों)
वाक्य - विन्यास
<sequence
id=ID
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
any attributes
>
(annotation?,(element|group|choice|sequence|any)*)
</sequence>
(चिह्न घोषित करता है कि तत्व अनुक्रम तत्व के अंदर शून्य या एक बार हो सकता है)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the sequence 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 sequence element can occur in the parent element. The value can be any number >= 0. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
उदाहरण 1
यह उदाहरण "personinfo" नामक तत्व के लिए एक घोषणा दिखाता है, जिसमें क्रम में निम्नलिखित पांच तत्व शामिल होने चाहिए; "प्रथम नाम", "अंतिम नाम", "पता", "शहर", और "देश":
<xs:element name="personinfo">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
उदाहरण 2
यह उदाहरण "पालतू जानवर" नामक तत्व के लिए एक घोषणा दिखाता है जिसमें अनुक्रम तत्व में शून्य या अधिक निम्न तत्व, कुत्ते और बिल्ली हो सकते हैं:
<xs:element name="pets">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dog" type="xs:string"/>
<xs:element name="cat" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
❮ पूर्ण XML स्कीमा संदर्भ