Re: <restriction> - Bad Kleene Notation

Hi Tim,

     You wrote:

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

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

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:simpleType>
         <xsd:restriction base = "xsd:integer">
            <xsd:minExclusive value = "100"/>
            <xsd:maxExclusive value = "500"/>
            <xsd:enumeration value  = "101"/>
            <xsd:enumeration value  = "499"/>
         </xsd:restriction>
      </xsd:simpleType>

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.

Thanks,

Henry
[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
mailto:zongaro@ca.ibm.com

Received on Wednesday, 26 September 2001 16:20:16 UTC