Re: Non-primitive built-in simple types

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