Reputation: 2873
I have the following code for my schema restriction:
<xs:simpleType name="myString">
<xs:restriction base="xs:string"/>
</xs:simpleType>
I was hoping when i made this type that users would not be able to use numbers and characters in their name but it does not restrict this. Is there an easy way to do this?
Thanks
Upvotes: 2
Views: 50
Reputation: 78467
<xs:simpleType name="myString">
<xs:restriction base="xs:string">
<xs:pattern value="([^0-9])*"/>
</xs:restriction>
</xs:simpleType>
Upvotes: 1
Reputation: 108957
<xs:restriction base="xs:string">
<xs:pattern value="([a-zA-Z])*"/>
</xs:restriction>
Upvotes: 2