I am using an xsd to validate my xml. One of the element AddressType should contain only one of the values (1,2,3).
<AddressType>1</AddressType>
I would like to provide information about this ids. e.g. 1 correspond to Home, 2 correspond to Work, etc.
I thought of using enumeration like this-
<xs:enumeration value="1" id="Home"/>
but this will fail if any other enumeration has same id. Is there a way that we can provide value as well as the information about the id.
My first suggestion is not to use id’s in XML (XML is human readable ;-)). If you have to then you can use xsd:annotation/xsd:documentation to provide what each of the id’s mean.