I was wondering whether it's possible to differentiate between ID fields in an XML schema. I'm having the following schema:
<element name="define_apple">
<complexType>
<attribute name="colour" type="ID"/>
</complexType>
</element>
<element name="define_orange">
<complexType>
<attribute name="colour" type="ID"/>
</complexType>
</element>
<element name="reference_apple">
<complexType>
<attribute name="colour" type="IDREF"/>
</complexType>
</element>
<element name="reference_orange">
<complexType>
<attribute name="colour" type="IDREF"/>
</complexType>
</element>
However, the references are not uniquely linked to the respective definitions. I can still write the following nonsense but valid XML:
<define_apple colour="green"/>
<define_orange colour="orange"/>
<reference_apple colour="orange"/>
<reference_orange colour="green"/>
Is there a way to link the fields correctly using ID and IDREF, for instance using namespaces? I know I could just use key and keyref, but the ID thing is a bit more appealing to me.