एक्सएसडी केवल टेक्स्ट कॉम्पोजिट एलीमेंट

केवल टेक्स्ट वाला संयुक्त एलिमेंट को टेक्स्ट और एट्रिब्यूट शामिल कर सकता है。

केवल टेक्स्ट वाला संयुक्त एलिमेंट

इस प्रकार का प्रकार केवल सरल सामग्री (टेक्स्ट और एट्रिब्यूट) को शामिल करता है, इसलिए हमें simpleContent एलिमेंट को इस सामग्री में जोड़ना होगा।simpleContent का उपयोग करते हुए, हमें simpleContent एलिमेंट के अंदर विस्तार या सीमा निर्धारित करना होगा: इस तरीके से:

<xs:element name="कोई नाम">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="basetype">
        ....
        ....
      </xs:extension>     
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

या:

<xs:element name="कोई नाम">
  <xs:complexType>
    <xs:simpleContent>
      <xs:restriction base="basetype">
        ....
        ....
      </xs:restriction>     
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

सूचना:extension या restriction एलिमेंट का उपयोग करके एलिमेंट के मूल सरल प्रकार को विस्तारित या सीमित करें。

यहाँ एक XML एलिमेंट का उदाहरण है, 'shoesize' जिसमें केवल टेक्स्ट है:

<shoesize country="france">35</shoesize>

इस उदाहरण में, एक संयुक्त प्रकार की घोषणा की गई है जिसकी सामग्री विन्यास गणितीय मान के रूप में है और 'shoesize' एलिमेंट में 'country' नाम का एट्रिब्यूट है:

<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>

हम complexType एलिमेंट को एक नाम दे सकते हैं और 'shoesize' एलिमेंट के type एट्रिब्यूट को इस नाम को संदर्भित करने दे (इस तरीके से, कई एलिमेंट एक ही संयुक्त प्रकार को संदर्भित कर सकते हैं):

<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>