XSD टेक्स्ट-ओनली एलिमेंट्स
एक जटिल टेक्स्ट-ओनली एलिमेंट में टेक्स्ट और एट्रीब्यूट्स हो सकते हैं।
जटिल पाठ-केवल तत्व
इस प्रकार में केवल साधारण सामग्री (पाठ और विशेषताएँ) होती हैं, इसलिए हम सामग्री के चारों ओर एक simpleContent तत्व जोड़ते हैं। सरल सामग्री का उपयोग करते समय, आपको simpleContent तत्व के भीतर एक एक्सटेंशन या प्रतिबंध को परिभाषित करना होगा, जैसे:
<xs:element name="somename">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="basetype">
....
....
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
OR
<xs:element name="somename">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="basetype">
....
....
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
युक्ति: विस्तार/प्रतिबंध तत्व का उपयोग तत्व के लिए आधार सरल प्रकार का विस्तार या सीमित करने के लिए करें।
यहाँ एक XML तत्व का उदाहरण दिया गया है, "shoesize", जिसमें केवल-पाठ शामिल है:
<shoesize country="france">35</shoesize>
निम्नलिखित उदाहरण एक जटिल प्रकार, "जूता आकार" घोषित करता है। सामग्री को एक पूर्णांक मान के रूप में परिभाषित किया गया है, और "shoesize" तत्व में "देश" नामक एक विशेषता भी शामिल है:
<xs:element name="shoesize">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
हम कॉम्प्लेक्स टाइप तत्व को एक नाम भी दे सकते हैं, और "शूसाइज" तत्व में एक प्रकार की विशेषता है जो कि कॉम्प्लेक्स टाइप के नाम को संदर्भित करती है (यदि आप इस विधि का उपयोग करते हैं, तो कई तत्व एक ही जटिल प्रकार को संदर्भित कर सकते हैं):
<xs:element name="shoesize" type="shoetype"/>
<xs:complexType name="shoetype">
<xs:simpleContent>
<xs:extension base="xs:integer">
<xs:attribute name="country" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>