Re: lexical value of decimal type

See comments below prefixed by AM>>

All the best, Ashok


"K.Kawaguchi" <k-kawa@bigfoot.com>@w3.org on 01/24/2001 04:17:07 PM

Sent by:  www-xml-schema-comments-request@w3.org


To:   www-xml-schema-comments@w3.org
cc:
Subject:  lexical value of decimal type




spec says

> 3.2.5.1 Lexical representation
> decimal has a lexical representation consisting of a finite-length
> sequence of decimal digits (#x30-#x39) separated by a period as a
> decimal indicator, in accordance with the scale and precision facets,
> with an optional leading sign. If the sign is omitted, "+" is assumed.
> Leading and trailing zeroes are optional. If the fractional part is
> zero, the period and following zero(es) can be omitted.
> For example: -1.23, 12678967.543233, +100000.00.

I have a problem understanding what exactly this "decimal digits separated
by a period" means.

So let me ask some quick questions.

Is ".001" a valid decimal?  AM>> Yes
Is "100." a valid decimal?  AM>> Yes
  (if "separation" allows 0-length, it should be valid)


If so, then ".000" is also a valid decimal. Is this correct?  AM>> Yes

If so, by applying a rule (the fracional part is zero, the period and
following zeroes can be omitted), "" is also a valid decimal, which
means 0. Is this correct?   AM>> No, that is not valid.

And by the adding optional leading sign, "+" is another valid decimal
that means 0. Is this correct?  AM>> No, that is not valid.


I really hope BNF of every datatype will be attached to the
recommendation spec. Sometimes, natural language is not accurate enough.


regards,
----------------------
K.Kawaguchi
E-Mail: k-kawa@bigfoot.com

Received on Wednesday, 24 January 2001 17:03:04 UTC