I wonder why instead of having to write
<xs:element name="elementName">
<xs:complexType>
<xs:sequence>
<xs:element name="subElementName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
I cannot specify as an attribute of element that it is of xs:complexType
? Or is there an xs:superSecretThingIdontKnowAbout
which combines xs:element
and xs:complexType
? While we're at it is there even something combining also xs:sequence
. What I would expect is that the code above could be written the following way.
<xs:superSecretThingIdontKnowAbout name="elementName" sequence="true">
<xs:element name="subElementName" type="xs:string"/>
<xs:superSecretThingIdontKnowAbout>
Context
Since XSD is XML and can be extended at wish, I want to add that I'm writing the schema for a field in a MySQL database. I don't know if this restricts anyhow the possibility. Any answer which doesn't work for that is welcome too, since this would confirm that I'm not the only one bothered by this fact.