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
Hello

	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:

      <restriction 
            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?))
      </restriction>

(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: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?

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?

Any clarification will be helpful.  Thank you.

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

PS
     For the first case, the "Schema Validator" by IBM generated the
following
     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 ...
          ERROR
          file = file:C:/Work/XML/NXSC/test.xsd line 13 column 57
          SEVERITY: 1
          ERROR TYPE: 1
          MESSAGE
          minExclusive is defined more than once.  The last value will be
used.
 
---------------------------------------------------------------------
          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 GMT

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