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

Clarification Request: Exclusive-Inclusive Derivations

From: Roberto Galnares <galnares@us.ibm.com>
Date: Fri, 23 Mar 2001 18:06:02 -0500
To: www-xml-schema-comments@w3.org
Message-ID: <OFFC05D0FA.5B88F404-ON85256A18.007CDD74@pok.ibm.com>
Clarification Request:

Consider the following example:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

     <xsd:simpleType name="sType01">
          <xsd:restriction base="xsd:integer">
               <xsd:minExclusive value="10"/>
               <xsd:maxExclusive value="20"/>
          </xsd:restriction>
     </xsd:simpleType>

     <xsd:simpleType name="sType02">
          <xsd:restriction base="sType01">
               <xsd:minInclusive value="12"/>
          </xsd:restriction>
     </xsd:simpleType>

     <xsd:simpleType name="sType03">
          <xsd:restriction base="sType01">
               <xsd:maxInclusive value="18"/>
          </xsd:restriction>
     </xsd:simpleType>

</xsd:schema>


There are conflicting views wrt the validity of this schema:

+ Arguments supporting the 'Invalid' position

[From XML Schema Part 2: Datatypes W3C Proposed Recommendation 16 March
2001]

4.3.8 maxExclusive

Constraint on Schemas: maxInclusive and maxExclusive
It is an error for both maxInclusive and maxExclusive to be specified for
the same datatype.

4.3.9 minExclusive

Constraint on Schemas: minInclusive and minExclusive
It is an error for both minInclusive and minExclusive to be specified for
the same datatype.

(BTW, these constraints are not listed in minInclusive and maxInclusive)

5.1.1 Derivation by restriction

Simple Type Definition Schema Component

{facets} The union of the set of Constraining facets (4.3) components
resolved to by the facet  [children] merged with {facets} from {base type
definition}, subject to the Facet Restriction Valid constraints specified
in Constraining facets (4.3).

Since {facets} from sType01 ({base type definition}) are inherited by
sType02\sType03, they contain minExclusive\maxExclusive and, therefore,
violate the constraints above.


+ Arguments supporting the 'Valid' position

[From XML Schema Part 2: Datatypes W3C Proposed Recommendation 16 March
2001]

2.5.2.1 Derived by restriction

[Definition:]  A datatype is said to be derived by restriction from another
datatype values for one or more constraining facets are specified that
serve to constrain its value space and/or its lexical space to a subset of
those of its base type.

(There seems to be some words missing between "... another datatype" and
"values for one ...")

4.3.7

Constraint on Schemas: maxInclusive valid restriction
It is an error if any of the following conditions is true:
...
2. maxExclusive is among the members of {facets} of {base type definition}
and {value} is greater than or equal to the {value} of the parent
maxExclusive
...

4.3.10

Constraint on Schemas: minInclusive valid restriction
It is an error if any of the following conditions is true:
...
3. minExclusive is among the members of {facets} of {base type definition}
and {value} is less than or equal to the {value} of the parent minExclusive
...

sType02 and sType03 follow the definition given in 2.5.2.1, they legally
restrict the value space of their base type. Furthermore, sType02 and
sType03 are not the same types as sType01, they do not contain
minExclusive\maxExclusive, their value space is just bounded (initially) by
the limits defined by sType01.

Additionaly, why would there be the additional constraints in 4.3.7 and
4.3.10 if these cases are prohibited by the constraints in 4.3.8 and 4.3.9?

*****

Which position is correct?

Thanks in advance for the help.


Roberto Galnares


PS: Logic != Knowledge
Received on Friday, 23 March 2001 18:06:46 GMT

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