You can restrict the string to a number of chars like this:
<xs:simpleType name="threeCharString">
<xs:annotation>
<xs:documentation>3-char strings only</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="3"/>
</xs:restriction>
</xs:simpleType>
The xs:length in the above limits the length of the string to exactly 3 chars. You can also use xs:minLength and xs:maxlength, or both.
You can provide a pattern like so:
<xs:simpleType name="fourCharAlphaString">
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z]{4}"/>
</xs:restriction>
</xs:simpleType>
The above says, 4 chars, of any of a-z, A-Z. The xs:pattern is a regular expression, so go to town with it.
You can restrict the string to a particular set of strings in this way:
<xs:simpleType name="iso3currency">
<xs:annotation>
<xs:documentation>ISO-4217 3-letter currency codes. Only a subset are defined here.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:length value="3"/>
<xs:enumeration value="AUD"/>
<xs:enumeration value="BRL"/>
<xs:enumeration value="CAD"/>
<xs:enumeration value="CNY"/>
<xs:enumeration value="EUR"/>
<xs:enumeration value="GBP"/>
<xs:enumeration value="INR"/>
<xs:enumeration value="JPY"/>
<xs:enumeration value="RUR"/>
<xs:enumeration value="USD"/>
</xs:restriction>
</xs:simpleType>