Re: fractionDigits facet

Hello,

     I sent the following to the Schema comments mailing list a few weeks 
ago, but never saw it in the archives, so I thought I'd better send it 
again.  My apologies if anyone sees this twice.

Thanks,

Henry
------------------------------------------------------------------
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 969-6044;  Phone (905) 413-6044
mailto:zongaro@ca.ibm.com

----- Forwarded by Henry Zongaro/Toronto/IBM on 02/03/06 09:59 AM -----


Henry Zongaro
02/02/21 06:30 PM

 
        To:     www-xml-schema-comments@w3.org, rthompson@contivo.com
        cc:     ashokma@microsoft.com, Paul.V.Biron@kp.org
        From:   Henry Zongaro/Toronto/IBM@IBMCA
        Subject:        Re: fractionDigits facet

 

Hi Ross,

     In [4] you wrote:
[[
Until yesterday's WG phone call, I thought that fractionDigits was a
constraint on the lexical space.  This made sense to me, and I knew
how to operationalize it.  I learned yesterday that it is a constraint
on the value space, and I now have no clear understanding from the
spec about what would validate against the following type:

<element "a">
  <simpleType>
    <restriction base="decimal">
      <fractionDigits value="2"/>
    </restriction>
  </simpleType>
</element>

Which of the following are legal?

<a>2.00</a>
<a>2.12</a>
<a>2.120<a>
<a>2.120000000000000000000000000000000000000<a>
<a>2.123<a>
<a>2.120000000000000000000000000000000000001<a>

My guess is that the last two are illegal, and the others are all ok.
My suggestion is that the spec spell this out better in the
description of the 'fractionDigits' facet, perhaps with an example
similar to mine.
]]

     I tripped across this a few weeks ago, but I came to the conclusion 
that fractionDigits constrains both the lexical space and the value space. 
 If you look at the definition of the lexical representation of decimal in 
3.2.3.1 [1], it states, in part, that "if fractionDigits is specified, the 
number of digits following the decimal point must be less than or equal to 
the fractionDigits."  That indicates to me that only the lexical values 
2.00 and 2.12 would meet the requirements of the fractionDigits facet of 
your example type.

     However, the description of the fractionDigits facet in 4.3.12 [2] 
doesn't mention that it constrains the lexical space in this way, i.e., by 
prohibiting excess trailing digits, including zeroes.  Contrast that with 
the description of the pattern facet in 4.3.4 [3] which explicitly states 
that it constrains the value space by constraining the lexical space.

     It's no longer clear to me whether the difference in style between 
4.3.12 and 4.3.4 means that it wasn't intended that fractionDigits should 
constrain the lexical space in this way (and that 3.2.3.1 is incorrect), 
or that it is merely a difference in style.  Does anyone know what was 
intended?

Thanks,

Henry
[1] http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#decimal-lexical-representation
[2] http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#rf-fractionDigits
[3] http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#rf-pattern
[4] 
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2002JanMar/0518.html
------------------------------------------------------------------
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 969-6044;  Phone (905) 413-6044
mailto:zongaro@ca.ibm.com

Received on Wednesday, 6 March 2002 10:04:12 UTC