Re: XML Datatype clarification: fractionDigits
Michael Kay <[email protected]> Tue, 25 Jun 2013 16:15:18 +0100
| Newsgroups | gmane.text.xml.schema.devel |
|---|---|
| Message-ID | <[email protected]> |
Yes. 4.3.12 says [Definition:] fractionDigits controls the size of the minimum = difference between values in the =B7value space=B7 of datatypes = =B7derived=B7 from decimal, by restricting the =B7value space=B7 to = numbers that are expressible as i =D7 10^-n where i and n are integers = and 0 <=3D n <=3D fractionDigits.=20 so setting fractionDigits restricts the value space to integer multiples = of 1x10^0, i.e. to whole numbers. The value 12 can still be written as = 12.0. This is not the same as xs:integer, because xs:integer also = restricts the lexical space. Michael Kay Saxonica=20 On 25 Jun 2013, at 15:45, Mukul Gandhi wrote: > 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"/>. >=20 > I think, doing this on xsd:decimal is perhaps equivalent to using = xsd:integer. >=20 >> My understanding of the specification is that there must be at most = the number of specified digits. >=20 > I agree. Thats what I can understand from spec also. >=20 >> 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 only >> 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 that >> the spec addresses this with lexical-canonical mappings. However = assume >> that a WSDL contains a restriction for zero fractionDigits. If a = value of >> "1.0" is input, should the input be rejected as it is incompatible = with the >> restriction, or should it be accepted since there is a valid mapping = to a >> canonical representation that would be compatible with the = restriction? >=20 > 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 >=20 >=20 > --=20 > Regards, > Mukul Gandhi >=20