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

<restriction> - Bad Kleene Notation?

From: MacAndrew, Tim <tmacandrew@NetSilicon.com>
Date: Mon, 27 Aug 2001 15:36:22 -0700
Message-ID: <AD77174F26BFD411BE7B00508BFDF56211FB12@newbury.netsilicon.com>
To: www-xml-schema-comments@w3.org

	I apologize if this topic has already been covered/discussed,
but my search of the database did not find any hits.

      From "XML Schema Part 1: Structures" the definition of
the <restriction> item within a <simpleContent> is:

            base = QName
            id = ID
            {any attributes with non-schema namespace . . .}>
        Content: (annotation?, (simpleType?,
                    (minExclusive | minInclusive | maxExclusive |
                     maxInclusive | totalDigits | fractionDigits |
                     length | minLength | maxLength | enumeration |
                     whiteSpace | pattern)*)?,
                  ((attribute | attributeGroup)*, anyAttribute?))

(from: (http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/)

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?

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?

Any clarification will be helpful.  Thank you.

Tim MacAndrew
NetSilicon - Softworks Group
e-Mail: TMacAndrew@NetSilicon.com

     For the first case, the "Schema Validator" by IBM generated the
     error message:

          Initializing Schema Quality Checker. Please wait ...
          SchemaQualityChecker has been initialized
          PROCESSING test.xsd time : 2001-08-22T15:49:43 ...
          test.xsd (file 1 of 1) now being read ...
          file = file:C:/Work/XML/NXSC/test.xsd line 13 column 57
          SEVERITY: 1
          ERROR TYPE: 1
          minExclusive is defined more than once.  The last value will be
          end time = 2001-08-22T15:49:45

     The warning is useful, but the validator is only "guessing" at the
     correct meaning.
Received on Monday, 27 August 2001 18:37:29 UTC

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