XML Schema Numeric Data Type
Decimal data type
The decimal data type is used to specify a value.
The following is an example of decimal number declaration in a scheme.
<xs:element name="prize" type="xs:decimal"/>
The elements in the document should look like this:
<prize>999.50</prize>
Or something like this:
<prize>+999.5450</prize>
Or similar to this:
<prize>-999.5230</prize>
Or similar to this:
<prize>0</prize>
Or something like this:
<prize>14</prize>
Note: The maximum number of decimal digits you can specify is 18 digits.
Integer data type
The integer data type is used to specify values without decimal components.
The following is an example of integer declaration in a scheme.
<xs:element name="prize" type="xs:integer"/>
The elements in the document should look like this:
<prize>999</prize>
Or something like this:
<prize>+999</prize>
Or similar to this:
<prize>-999</prize>
<prize>-999</prize>
Or similar to this:
< ;prize>0</prize>
Numeric data type
Please note that all the following data types are derived from the decimal data type (Except decimal itself)!
Name | Seconds |
---|---|
positive or negative 8-bit integer | |
Decimal number | |
32-bit integer with positive and negative | |
Integer value | |
A positive and negative 64-bit integer | |
Integers containing only negative values (.., -2, -1.) | |
Contains only non-negative integers (0, 1, 2, ..) | |
Contains only non-positive integers (.., - 2, -1, 0) | |
Integers containing only positive values (1, 2, ..) | |
16-bit integer with positive and negative signs | |
64-bit integer with no positive and negative signs | |
Unsigned 32-bit integer | |
Unsigned 16-bit integer | |
Unsigned 8-bit integer |
- enumeration
- fractionDigits
- maxExclusive
- maxInclusive
- minExclusive
- minInclusive
- pattern
- totalDigits
- whiteSpace