We have a lot of serialization done through MS XML 4. When we serialize C++ enums we use a table to translate each possible value to a string and them store that string as an attribute value. When we deserialize we read that attribute value, compare it against all items in the table and retrieve the corresponding enum value. If we fail to find we raise an error.
To facilitate creating XMLs by external programs we published XML schemas for all data types of interest. Attributes for enums are defined as follows:
<xs:complexType>
//other fields here
<xs:attribute name="Color" type="xs:string"></xs:attribute>
</xs:complexType>
It works, but contains no definitions for what are possible string values. How could I add possible values to this definition? Do I use xs:choice for that?