I have a type named AdapterInputDataType that defines a format of some kind of input data:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://companyname.org/AdapterInputDataTypeNS"
xmlns:tns="http://companyname.org/AdapterInputDataTypeNS"
>
<complexType name="AdapterInputDataType">
<sequence>
<element name="atomicElement" type="tns:AtomicElementType" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
<complexType name="AtomicElementType">
<simpleContent>
<extension base="tns:AtomicElementValueType">
<attribute name="elementName" type="tns:AtomicElementNameType" use="required"/>
</extension>
</simpleContent>
</complexType>
<simpleType name="AtomicElementValueType">
<union memberTypes="string long decimal dateTime boolean"/>
</simpleType>
<simpleType name="AtomicElementNameType">
<restriction base="string">
<enumeration value="foo"/>
<enumeration value="bar"/>
<enumeration value="baz"/>
</restriction>
</simpleType>
</schema>
AdapterInputDataType is intended to define an element of this type inside of several namespaces:
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://companyname.org/adapter1"
xmlns:tns="http://companyname.org/adapter1"
xmlns:inptypns="http://companyname.org/AdapterInputDataTypeNS"
>
<import namespace="http://companyname.org/AdapterInputDataTypeNS"/>
<element name="adapterInputData" type="inptypns:AdapterInputDataType"/>
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://companyname.org/adapter2"
xmlns:tns="http://companyname.org/adapter2"
xmlns:inptypns="http://companyname.org/AdapterInputDataTypeNS"
>
<import namespace="http://companyname.org/AdapterInputDataTypeNS"/>
<element name="adapterInputData" type="inptypns:AdapterInputDataType"/>
</schema>
The problem is that for each namespace the type is imported to a specific set of allowed values for elementName attribute should be defined. In other words, in different namespaces AdapterInputDataType should be based on different AtomicElementNameType types.
Is there a way to use in AdapterInputDataType definition some kind of parameter instead of AtomicElementNameType and put different AtomicElementNameType types in different namespaces as value of this parameter?