W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

SimpleTypes derived by restriction

From: Ray Waldin <rwaldin@pacbell.net>
Date: Wed, 26 Apr 2000 03:45:10 -0700
Message-ID: <000501bfaf6c$7fa7dee0$bec90640@lexica.net>
To: <www-xml-schema-comments@w3.org>
Hello,

I have some questions and a comment concerning SimpleTypes derived "by
restriction".  To illustrate:

<simpleType name="firstType" base="decimal">
  <minInclusive value="1"/>
  <maxInclusive value="10"/>
</simpleType>

<simpleType name="secondType" base="firstType">
  <minInclusive="2"/>
  <maxInclusive="5"/>
</simpleType>

This seems perfectly acceptible as secondType is derived from firstType "by
restricting its value space", by specifying "more restrictive" values for
some facets.  Here's a case that's not so obvious, using "less restrictive"
values:

<simpleType name="thirdType" base="firstType">
  <minInclusive="0"/>
  <maxInclusive="11"/>
</simpleType>

My questions:

Is this disallowed or just pointless?  In other words, should a schema
processor regard this type derivation as an error, or simply produce a
thirdType which is no more restrictive than firstType?

What does "more restrictive" mean for the period and duration facets?  Can
period and duration be re-specified in any meaningful way or is
re-specifying either of these values disallowed?

If a derived type re-specifies the pattern facet (as in the case of NCName
and Name), are schema processors expected to:
    A) ensure that a derived type specifies a "more restrictive" pattern
than its base type, or
    B) check all patterns in a type's derivation hierarchy when validating
an instance of that type?

My comment:

The datatypes spec should elaborate on the expected behavior of schema
processors when encountering derived types which re-specify values for each
facet.

-Ray
Received on Wednesday, 26 April 2000 06:42:26 UTC

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