Name

xs:decimal — Decimal numbers.

Derived from:

xs:anySimpleType

Primary:

xs:decimal

Known subtypes:

xs:integer

Facets:

xs:enumeration, xs:fractionDigits, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:totalDigits, xs:whiteSpace

<xs:simpleType name="decimal" id="decimal">
  <xs:restriction base="xs:anySimpleType">
    <xs:whiteSpace value="collapse" fixed="true"/>
  </xs:restriction>
</xs:simpleType>

Description

xs:decimal is the datatype that represents the set of all the decimal numbers with arbitrary lengths. Its lexical space allows any number of insignificant leading and trailing zeros (after the decimal point).

Restrictions

The decimal separator is always a point (“.”) and no thousand separator may be added. There is no support for scientific notations.

Example

Valid values include: "123.456", "+1234.456", "-1234.456", "-.456", or "-456".

The following values would be invalid: "1 234.456" (spaces are forbidden), "1234.456E+2" (scientific notation ("E+2") is forbidden), "+ 1234.456" (spaces are forbidden), or "+1,234.456" (delimiters between thousands are forbidden).

Get XML Schema now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.