I have given
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="AdditionalAttribute.OtherXSD"
xmlns:o="AdditionalAttribute.OtherXSD"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:element name="Tag" type="o:TagType" />
<xs:complexType name="TagType" />
</xs:schema>
and I want to write
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="AdditionalAttribute.MyXSD"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<!-- ? -->
</xs:schema>
so this becomes valid XML:
<?xml version="1.0" encoding="UTF-8"?>
<o:Tag
xmlns:o="AdditionalAttribute.OtherXSD"
xmlns:m="AdditionalAttribute.MyXSD"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
AdditionalAttribute.OtherXSD AdditionalAttribute.OtherXSD.xsd
AdditionalAttribute.MyXSD AdditionalAttribute.MyXSD.xsd
"
m:AdditionalAttribute="Value"
/>
I am aware of a similar question, that asks how to place an additional attribute to all complex types in another XSD. The answer for that is no. However, I'm not an expert in this and from the answers there I cannot derieve if it would be possible for a specific complex type. I tried several things without success and it seems that this is only possible by xsd:extension'ing or xsd:restriction'ing a complex type, thus derieving a new one, which is not what I want. I want to "merge" attributes on the same tag:
<o:Tag o:...=... />
+ <o:Tag m:...=... />
= <o:Tag o:...=... m:...=... />
Is this possible and how?