ある種の入力データの形式を定義する AdapterInputDataType という名前の型があります。
<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 は、いくつかの名前空間内でこの型の要素を定義することを目的としています。
<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>
問題は、名前空間ごとに、要素名属性の特定の許可された値のセットに型がインポートされることです。定義する必要があります。つまり、異なる名前空間では、 AdapterInputDataType は異なる AtomicElementNameType タイプに基づく必要があります。
AdapterInputDataType 定義で AtomicElementNameType の代わりにある種のパラメータを使用し、このパラメータの値として異なる名前空間に異なる AtomicElementNameType タイプを配置する方法はありますか?