एक्सएमएल स्कीमा कॉम्प्लेक्स सामग्री तत्व
❮ पूर्ण XML स्कीमा संदर्भ
परिभाषा और उपयोग
जटिल सामग्री तत्व एक जटिल प्रकार पर एक्सटेंशन या प्रतिबंधों को परिभाषित करता है जिसमें केवल मिश्रित सामग्री या तत्व होते हैं।
तत्व जानकारी
- मूल तत्व: जटिल प्रकार
वाक्य - विन्यास
<complexContent
id=ID
mixed=true|false
any attributes
>
(annotation?,(restriction|extension))
</complexContent>
(? चिन्ह यह घोषणा करता है कि तत्व जटिल सामग्री तत्व के अंदर शून्य या एक बार हो सकता है)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
mixed | Optional. Specifies whether character data is allowed to appear between the child elements of this complexType element. Default is false |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
उदाहरण 1
निम्नलिखित उदाहरण में एक जटिल प्रकार है, "फुलपर्सनइन्फो", जो एक अन्य जटिल प्रकार, "पर्सनइन्फो" से प्राप्त होता है, जो विरासत में मिले प्रकार को तीन अतिरिक्त तत्वों (पता, शहर और देश) के साथ विस्तारित करता है:
<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
"कर्मचारी" तत्व के ऊपर के उदाहरण में, क्रम में, निम्नलिखित तत्व होने चाहिए: "प्रथम नाम", "अंतिम नाम", "पता", "शहर" और "देश"।
❮ पूर्ण XML स्कीमा संदर्भ