XML Schema is a language and framework for validating XML documents.
An XML document that is well-formed, in the sense that it is syntactically conformant to the XML specification, can be tested for validity against a schema. The distinction between well-formedness, which is absolute, and validity, which is relative to a schema, is paramount.
Validation encompasses:
XML Schema was introduced to address requirements that DTD validation failed to address, among others a more complete type system including a rich set of builtin types, type restriction and extension capabilities, and more control on the restriction of element layout.
Deriving from a xs:complexType
When a xs:complexType derives from another xs:complexType is can do it via extension or restriction.
Deriving from a xs:simpleType
When a xs:complexType derives from a xs:simpleType is can do it via extension, in which case it can add attributes to the resulting type, but not elements.
Content Type
Conceptually a xs:complexType either contains simple or complex content. If the xs:complexType derives from a typed based on xs:anySimpleType (xs:int, xs:string etc) then it is simple. If it derives from a xs:complexType which contains complex content, then it itself is complex (if the xs:complexType does not derive from a type, then it is also complex).