I have a question regarding polymorphism in XML Schemas. If I have a schema file 1.xsd which derives a new complextype "type2" from a type "type1" defined in another schema 2.xsd. 2.xsd is present as a namespace in 1.xsd, how would polymorphism work in this case.

For instance if I define an element with the type "type1" from 2.xsd, am I only allowed to use use derived type "type2" in 1.xsd or all derived types in 1.xsd and 2.xsd or any other schema for instance "type3" in 3.xsd. How does it work?