=head1 NAME XML::Compile::Schema::BuiltInTypes - Define handling of built-in data-types =head1 INHERITANCE XML::Compile::Schema::BuiltInTypes is a Exporter =head1 SYNOPSIS # Not for end-users use XML::Compile::Schema::BuiltInTypes qw/%builtin_types/; =head1 DESCRIPTION Different schema specifications specify different available types, but there is a lot over overlap. The L module defines the availability, but here the types are implemented. This implementation certainly does not try to be minimal in size: using the restriction rules and inheritance structure defined in the schema specification would be too slow. =head1 FUNCTIONS The functions named in this chapter are all used at compile-time by the translator. At that moment, they will be placed in the kind-of opcode tree which will process the data at run-time. You B these functions yourself. =head2 Any B =over 4 =back B =over 4 Both any*Type built-ins can contain any kind of data. Perl decides how to represent the passed values. =back =head2 Ungrouped types B =over 4 Contains C, C, C<1> (is true), or C<0> (is false). When the writer sees a value equal to 'true' or 'false', those are used. Otherwise, the trueth value is evaluated into '0' or '1'. The reader will return '0' (also when the XML contains the string 'false', to simplify the Perl code) or '1'. =back B =over 4 =back =head2 Big Integers Schema's define integer types which are derived from the C type. These values can grow enormously large, and therefore can only be handled correctly using Math::BigInt. When the translator is built with the C option, this will simplify (speed-up) the produced code considerably: all integers then shall be between -2G and +2G. B =over 4 An integer with an undertermined (but possibly large) number of digits. =back B =over 4 A little bit shorter than an integer, but still up-to 19 digits. =back B =over 4 =back B =over 4 =back B =over 4 =back B =over 4 =back B =over 4 Just too long to fit in Perl's ints. =back B =over 4 Value up-to 20 digits. =back =head2 Integers B =over 4 Signed 8-bits value. =back B =over 4 =back B =over 4 PARTIAL IMPLEMENTATION. Special values INF and NaN not handled. =back B =over 4 Signed 16-bits value. =back B(Short) =over 4 unsigned 16-bits value. =back B =over 4 Unsigned 8-bits value. =back =head2 Floating-point PARTIAL IMPLEMENTATION: INF, NaN not handled. The C is not limited in size, but mapped on double. B =over 4 Decimals are painful: they can be very large, much larger than Perl's internal floats. The value is therefore kept as string. Use Math::BigFloat when you need calculations. You can also pass such object here. =back B =over 4 A floating-point value. =back B =over 4 A small floating-point value. =back =head2 Encoding B =over 4 In the hash, it will be kept as binary data. In XML, it will be base64 encoded. =back B =over 4 In the hash, it will be kept as binary data. In XML, it will be hex encoded, two hex digits per byte. =back =head2 Dates B =over 4 A day, represented in localtime as C or C. When a decimal value is passed, it is interpreted as C