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

Re: Non-primitive built-in simple types

From: <Paul.V.Biron@kp.org>
Date: Tue, 26 Jul 2005 11:57:31 -0700
To: Alain.Frisch@inria.fr
Cc: www-xml-schema-comments@w3.org
Message-Id: <OF059B3E8D.A4EC2135-ON8825704A.00675C27-8825704A.006824D8@KP.ORG>

> <<
> integer is ·derived· from decimal by fixing the value of 
> ·fractionDigits· to be 0and disallowing the trailing decimal point.
>  >>
> 
> (btw, there is a missing whitespace after 0)
> 
> The facet fractionDigits only restricts the value space, not directly 
> the lexical space, so setting it to 0 does not disallow the trailing 
> decimal point. This could be done using the pattern facet, but the 
> definition does not mention this facet.

Actually, there is a pattern facet which implements "disallowing the 
trailing decimal point".  Here is the type definition as it exists in the 
schema-for-schemas:

<xs:simpleType name="integer" id="integer">
   <xs:restriction base="xs:decimal">
      <xs:fractionDigits value="0" fixed="true" 
id="integer.fractionDigits"/>
      <xs:pattern value="[\-+]?[0-9]+"/>
   </xs:restriction>
</xs:simpleType>

This pattern facet wasn't there in the first edition and, hence, there was 
some "magic" with integer...but this was cleaned up with the 2nd edition.

The current editor's draft of Datatypes [member's only link, 1] includes a 
subsection for all builtin datatypes that shows the values of all facets 
that are set in the type def for that type.

True, it would probably be clearer to also change the definition of 
integer to:

        [Definition:] integer is derived from decimal by
        fixing the value of ·fractionDigits· to be 0 and
        fixing the value of pattern to be [\-+]?[0-9]+
        (thus disallowing the trailing decimal point)...

pvb

[1] http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.html
Received on Tuesday, 26 July 2005 19:05:11 GMT

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