XML technologies / XML Schema / XML Schema element reference / xs:totalDigits
(Excerpt from “XML Schema” by Eric van der Vlist)
Facet specifying the total digit count of a numeric data type.
<xs:totalDigits
fixed = xs:boolean : "false"
id = xs:ID
value = xs:positiveInteger
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?)
</xs:totalDigits>May occur within: xs:restriction (simple type), xs:restriction (simple content)
May be used as a facet for: xs:byte, xs:decimal, xs:int, xs:integer, xs:long, xs:negativeInteger, xs:nonNegativeInteger, xs:nonPositiveInteger, xs:positiveInteger, xs:short, xs:unsignedByte, xs:unsignedInt, xs:unsignedLong, xs:unsignedShort
Description
xs:totalDigits specifies the maximum digit count for data type decimal and derived types, before and after the decimal point, excluding the point itself.
This facet restricts the value space: digits are counted after conversion to canonical form and removal of leading and trailing zeros.
Restrictions
It is also possible to use xs:pattern to restrict the total digit count in the lexical space.
Within a restriction step, an interaction exists between xs:totalDigits and xs:fractionDigits, since inconsistent values produce data types with empty value spaces.
xs:totalDigits must restrict its base type’s value space. The value must be smaller than the base type’s xs:totalDigits value, if defined.
Example
<xs:simpleType name="totalDigits">
<xs:restriction base="xs:integer">
<xs:totalDigits value="5"/>
</xs:restriction>
</xs:simpleType>
Attributes
fixed
If the value is true, the facet’s value cannot be changed during further restriction.
id
Element ID according to W3C XML Schema.
value
Facet value.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de