W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Implicit vs explicit datatype semantic.

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Tue, 30 Oct 2001 10:39:17 +0100
Message-ID: <3BDE7545.60702@dyomedea.com>
To: xmlschema-dev@w3.org

This is probably more a question for schema tools developers than for 
the WG itself... I am wondering if the schema processors will be able to 
derive the implicit semantic from the restrictions and pass them to the 
applications (when APIs will be available for this) or if the schema 
authors should surcharge the definitions of datatype to provide as much 
information as needed.

Let's take the simplistic example of a byte with 3 possible values "-1" 
and "1".

The minimal definition for this datatype is probably:

<xs:simpleType name="myByte">
  <xs:restriction base="xs:byte">
   <xs:enumeration value="-1"/>
   <xs:enumeration value="1"/>

However, is there a chance that a schema processor deduces from the 
above "implied" facets such as:

  <xs:minInclusive value="-1"/>
  <xs:maxInclusive value="1"/>
  <xs:minExclusive value="-2"/>
  <xs:maxExclusive value="2"/>
  <xs:totalDigits value="1"/>

The problem happens also when you constrain the lexical space. If I had 
needed to disallow the leading zeros from the lexical space of my 
datatype, I could have written this type as:

<xs:simpleType name="myByte">
  <xs:restriction base="xs:byte">
   <xs:pattern value="-1"/>
   <xs:pattern value="1"/>

or even

<xs:simpleType name="myByte">
  <xs:restriction base="xs:byte">
   <xs:pattern value="-?1"/>

Would a schema processor be able to tell to an application that this is 
an enumeration of two byte values?

This is not very likely IMHO.

Does that mean that schema authors should be advised to add redundant 
facets in provision of future schema tools which will draw informations 
from the schemas ?

The rec doesn't specify such inferences in the PSVI which seems lead to 
this conclusion too...


Rendez-vous  Paris pour le Forum XML.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Tuesday, 30 October 2001 04:38:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:55 UTC