Q:

XML how to restrict string input between a list of words

i have the type genretype for a "book" like complex element and i want to add a restriction so the user can only insert one of the 3 types (Horror, Thriller, Action) of genre available, how can i do that?
<xs:simpleType name="genretype">
    <xs:restriction base="xs:string">
        <!-- restriction goes here -->

    </xs:restriction>
</xs:simpleType>

A:

Just enumerate the values:
<xs:enumeration value="Horror"/>
<xs:enumeration value="Thriller"/>
<xs:enumeration value="Action"/>

