<xs:simpleType name="eircode" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:restriction base="xs:string"> <xs:minLength value="7" /> <xs:maxLength value="8" /> <xs:pattern value="[A-Za-z0-9 ]*" /> </xs:restriction> </xs:simpleType>