August 2003
Beginner to intermediate
240 pages
7h 44m
English
xs:decimal
Defined in: XML Schema part 2
Any decimal number can be exactly represented by this datatype.
The definition of this datatype defines no restrictions whatsoever on the size of numbers permissible under this datatype. Unless your form processing is prepared to deal with a number thousands of digits long (or even longer), you should use a restriction on the allowed upper and lower limits, and number of digits past the decimal point, as shown here:
<xs:simpleType name="restrictedInteger">
<xs:restriction base="xs:decimal">
<xs:maxExclusive value="1000000"/>
<xs:minInclusive value="-1000000"/>
<xs:fractionDigits value='2'/>
</xs:restriction>
</xs:simpleType>3.14
-12345678901234567890123456789012345
0.318309886
Read now
Unlock full access