W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2001

Re: <restriction> - Bad Kleene Notation

From: <zongaro@ca.ibm.com>
Date: Wed, 26 Sep 2001 16:18:54 -0400
To: www-xml-schema-comments@w3.org, tmacandrew@NetSilicon.com
Message-ID: <OF364FB0E3.1D5FE296-ON85256AD3.006D6396@torolab.ibm.com>
Hi Tim,

     You wrote:

The use of the Kleene operator * in the "Content" section allows for
a schema item such as:

         <xsd:restriction base = "xsd:integer">
            <xsd:minExclusive value = "100"/>
            <xsd:minExclusive value = "10"/>

since the * operator allows 0 or more occurrences of each of the items
within the parentheses.  But, as the example shows, it is semantically
invalid to use the <minExclusive> item more than once.

QUESTION:  Is the definition for the <restriction> item correct, or are
           such expressions valid?

Your example is prohibited by section 4.1.3 of the XML Schema: Datatypes 
recommendation [1], which indicates that only the pattern and enumeration 
constraining facets can be repeated in a single derivation.

Also, the statement:

         <xsd:restriction base = "xsd:integer">
            <xsd:minExclusive value = "100"/>
            <xsd:maxExclusive value = "500"/>
            <xsd:enumeration value  = "101"/>
            <xsd:enumeration value  = "499"/>

is a valid schema item.  However, it is semantically ambiguous.  Are
the values restricted to only "101" and "499", or are all values
between "101" and "499" valid?

Section 4.1.4 of Datatypes ("Simple Type Definition Validation Rules") [2] 
indicates that a value must be valid with respect to all members of 
{facets}.  So I believe that only the values 101 and 499 are valid with 
respect to your example xsd:simpleType.

     I hope that helps.


[1] http://www.w3.org/TR/xmlschema-2/#src-single-facet-value
[2] http://www.w3.org/TR/xmlschema-2/#defn-validation-rules
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 969-6044;  Phone (905) 413-6044
Received on Wednesday, 26 September 2001 16:20:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:57 UTC