The reason appears to be that you have the incorrect order in your XML example when you have defined the following XSD:
<xs:element name="label" type="xs:string"/>
<!-- image -->
<xs:element name="image" >
<xs:complexType>
<xs:attribute name="src" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<!-- textbox -->
<xs:element name="textbox">
<xs:complexType>
<xs:attributeGroup ref="basics"/>
<xs:attribute name="hint" type="xs:string" use="optional" default=""/>
</xs:complexType>
</xs:element>
I am not an XSD expert but I was curious about your question and read the following on W3Schools.com. I hope I am reading this correctly, I just wanted to show what I have found researching your question.
http://www.w3schools.com/Schema/schema_complex.asp
. The "employee" element can be declared directly by naming the element, like this:
<xs:element name="employee">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
If you use the method described above, only the "employee" element can use the specified complex type. Note that the child elements, "firstname" and "lastname", are surrounded by the indicator. This means that the child elements must appear in the same order as they are declared. You will learn more about indicators in the XSD Indicators chapter.