Implicit vs explicit datatype semantic.

Hi,

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"/>
  </xs:restriction>
</xs:simpleType>

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"/>
  </xs:restriction>
</xs:simpleType>

or even

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

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...

Thanks

Eric
-- 
Rendez-vous à Paris pour le Forum XML.
                    http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
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