W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2008

[Bug 6249] New: exclusions for simple type

From: <bugzilla@wiggum.w3.org>
Date: Thu, 27 Nov 2008 12:05:38 +0000
To: www-xml-schema-comments@w3.org
Message-ID: <bug-6249-703@http.www.w3.org/Bugs/Public/>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=6249

           Summary: exclusions for simple type
           Product: XML Schema
           Version: Future
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Datatypes: XSD Part 2
        AssignedTo: cmsmcq@w3.org
        ReportedBy: van_hagen_sjoerd@hotmail.com
         QAContact: www-xml-schema-comments@w3.org


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.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Thursday, 27 November 2008 12:05:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:16 GMT