Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

XML Schema numeric data type


May 28, 2021 XML Schema


Table of contents


XSD Numeric data type

This section explains the numeric data types in XML Schema.



The hedding data type

The hedding data type is used to specify a value.

Here is an example of a hedding declaration in a scheme.

<xs:element name="prize" type="xs:decimal"/>

The elements in the document should look something like this:

<prize>999.50</prize>

Or something like this:

<prize>+999.5450</prize>

Or something like this:

<prize>-999.5230</prize>

Or something like this:

<prize>0</prize>

Or something like this:

<prize>14</prize>

Note: The maximum number of digits you can specify for a hedding number is 18 digits.


The integer data type

Integer data types are used to specify values that do not have a component.

Here is an example of an integer declaration in a scheme.

<xs:element name="prize" type="xs:integer"/>

The elements in the document should look something like this:

<prize>999</prize>

Or something like this:

<prize>+999</prize>

Or something like this:

<prize>-999</prize>

Or something like this:

<prize>0</prize>


Numeric data type

Note that all of the following data types originate from decimal data types (except decimal itself)!

Name The number of seconds
byte There are positive and negative 8-bit integers
decimal The number of hedies
Int There are positive and negative 32-bit integers
integer The integer value
long There are positive and negative 64-bit integers
negativeInteger Contains only integers with negative values ( ., -2, -1.)
nonNegativeInteger Contains only integers with non-negative values (0, 1, 2, .)
nonPositiveInteger Contains only non-positive integers (., -2, -1, 0)
positiveInteger Contains only positive integers (1, 2, .)
short There are positive and negative 16-bit integers
unsignedLong 64-bit integer without positive or negative
unsignedInt 32-bit integer without positive or negative
unsignedShort No positive or negative 16-bit integers
unsignedByte No positive or negative 8-bit integers


Limiting numeric data types (Restriction)

Qualifications that can be used with numeric data types:

  • enumeration
  • fractionDigits
  • maxExclusive
  • maxInclusive
  • minExclusive
  • minInclusive
  • pattern
  • totalDigits
  • whiteSpace

Read about it

Count by bit