All my XML attributes are in a different namespace, so my XSD references them from the other XSD. I have two different elements with an attribute with the same name, but different types.
<integer ons:name="10" />
<string ons:name="string"/>
So the integer element has a ons:name attribute that is an integer while the string element has a ons:name attribute that is a string.
How do I define that in the XSD? Currently I have:
<xs:element name="integer">
<xs:complexType>
<xs:attribute ref="ons:name" use="required"/>
</xs:complexType>
</xs:element>
Then in the second XSD for the ons namespace I have the following:
Then the problem is for the second element’s attribute there is no way to specify the type with the ref, and if the ref references a different attribute then it gets a different name.
In the schema document for namespace
ons, define two singleton attribute groups:Then reference the attribute group from the complex type: