This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I would like to have a feature added to the XML schema specification. It is quite simple to understand and implement and adds considerable power to schema as a validation tool. I propose to add the element exclude to the restriction that can be used in simple types. This can be very useful to model identifiers, where you want to exclude reserved words but cannot enumerate all possibilities you do want to allow. Say you would like to have identifiers consisting of upper and lowercase characters and digits, which have to start with a character and 'int', 'double' and 'string' are forbidden it would look like this: <xs:simpleType name="identifier" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:restriction base="xs:string"> <xs:pattern value="[A-Za-z][A-Za-z0-9]*"/> <xs:minLength value="1"/> <xs:maxLength value="32"/> <xs:exclude value="int"/> <xs:exclude value="double"/> <xs:exclude value="string"/> </xs:restriction> </xs:simpleType> At this moment there is no way to do this in schema and even with extended regular expression power it would be a pain while it can be very useful in many cases.
Assertions in XSD 1.1 provide a way to do this: <xs:assert test="not(. = ('int', 'double', 'string'))"/> Michael Kay (personal response)