Re: XML Datatype clarification: fractionDigits
Mukul Gandhi <[email protected]> Tue, 25 Jun 2013 20:15:52 +0530
| Newsgroups | gmane.text.xml.schema.devel |
|---|---|
| Message-ID | <CABuuzNMw8-_XJaaodVQx_=dO5_=jksxPprZqVqpdPx7yx4B=Sw@mail.gmail.com> |
On Fri, Jun 21, 2013 at 11:35 PM, Nochum Klein <[email protected]> wrote: > I was hoping to get some clarification regarding the use of > <xsd:fractionDigits value=3D"0"/>. I think, doing this on xsd:decimal is perhaps equivalent to using xsd:integ= er. > My understanding of the specification is that there must be at most the n= umber of specified digits. I agree. Thats what I can understand from spec also. > Therefore if it's zero then there MUST be zero digits (and "1..0" should = be represented as > "1"). Where the fractionDigits is set to zero, the resulting value can o= nly > be supported in a lexical representation of the "xsd:decimal" data type > (e.g. 1), but not the canonical one (which requires 1.0). I understand t= hat > the spec addresses this with lexical-canonical mappings. However assume > that a WSDL contains a restriction for zero fractionDigits. If a value o= f > "1.0" is input, should the input be rejected as it is incompatible with t= he > restriction, or should it be accepted since there is a valid mapping to a > canonical representation that would be compatible with the restriction? The spec of xsd:fractionDigits says, "it does not restrict the =B7lexical space=B7 directly; a lexical representation that adds non-significant leading or trailing zero digits is still permitted.". My reading of this says, if an input value is 1.0 and xsd:fractionDigits value=3D"0" then this value would be reported as valid, since in this case trailing zero was removed and than validation was done. --=20 Regards, Mukul Gandhi