I'm trying to represent a class that, amongst other things, has a set of days of the week - for example, it could be empty, it could be Monday, Wednesday, and Thursday, or could be all seven days. Obviously it shouldn't allow the same day more than once. I'm also trying to generate the classes from an XSD using xsd.exe or another tool.
I'm not asking which method is best, but for answers on how to accomplish this in any sensible way. For example, I don't mind whether the class has a Boolean for each day of the week, or a hash set limited to the values in an enum. The target language is C#/.NET3.5.
Trouble is, I've got a mind blank on how to represent this in XSD format! Here's what I've got so far:
<xs:simpleType name="daysOfWeek">
<xs:restriction base="xs:string">
<xs:enumeration value="Monday"/>
<xs:enumeration value="Tuesday"/>
<xs:enumeration value="Wednesday"/>
<xs:enumeration value="Thursday"/>
<xs:enumeration value="Friday"/>
<xs:enumeration value="Saturday"/>
<xs:enumeration value="Sunday"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="runDays">
<!-- Set of days of the week goes here -->
</xs:complexType>