The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SOAP::WSDL::XSD::Typelib::Builtin - Built-in XML Schema datatypes

DESCRIPTION

This module implements all builtin Types from the XML schema specification.

Objects of a class may be filled with values and serialize correctly.

These basic type classes are most useful when used as element or simpleType base classes.

The datatypes classes themselves are split up into SOAP::WSDL::XSD::Typelib::Builtin::* modules.

Using SOAP::WSDL::XSD::Typelib::Builtin uses all of the builtin datatype classes.

EXAMPLES

 my $bool = SOAP::WSDL::XSD::Typelib::Builtin::bool->new({ value => 0} );
 print $bool;    # prints "true"

 # implements <simpleType name="MySimpleType">
 #               <list itemType="xsd:string" />
 #            </simpleType>
 package MySimpleType;
 use SOAP::WSDL::XSD::Typelib::Builtin;
 use SOAP::WSDL::XSD::Typelib::SimpleType;

 use base qw(SOAP::WSDL::XSD::Typelib::SimpleType
    SOAP::WSDL::XSD::Typelib::Builtin::list
    SOAP::WSDL::XSD::Typelib::Builtin::string
 );
 1;

 # somewhere else
 my $list = MySimpleType->new({ value => [ 'You', 'shall', 'overcome' ] });
 print $list;   # prints "You shall overcome"

CLASS HIERARCHY

This is the inheritance graph for builtin types.

Types with [] marker describe types derived via the item in [] in the XML Schema specs.

Derivation is implemented via multiple inheritance with the derivation method as first item in the base class list.

 anyType
 - anySimpleType
     - duration
     - dateTime
     - date
     - time
     - gYearMonth
     - gYear
     - gMonthDay
     - gDay
     - gMonth
     - boolean
     - base64Binary
     - hexBinary
     - float
     - decimal
         - integer
         - nonPositiveInteger
             - negativeInteger
         - nonNegativeInteger
             - positiveInteger
             - unsignedLong
             - unsignedInt
             - unsignedShort
             - unsignedByte
         - long
             - int
                 - short
                     - byte
     - double
     - anyURI
     - string
          - normalizedString
              - language
              - Name
                  - NCName
                      - ID
                      - IDREF
                          - IDREFS [list]
                      - ENTITY
              - NMTOKEN
                  - NMTOKENS [list]

OVERLOADED OPERATORS

Overloading is implemented via Class::Std's trait mechanism.

The following behaviours apply:

  • string context

    All classes use the serialize method for stringification.

  • bool context

    All classes derived from anySimpleType return their value in bool context

  • numeric context

    The boolean class returns 0 or 1 in numeric context.

    decimal, float and double (and derived classes) return their value in numeric context.

Subclasses

SOAP::WSDL::XSD::Typelib::Builtin::anyType

Base class for all types

SOAP::WSDL::XSD::Typelib::Builtin::anySimpleType

Base class for all simple types

SOAP::WSDL::XSD::Typelib::Builtin::anyURI

Type representing URIs

SOAP::WSDL::XSD::Typelib::Builtin::boolean

Represents boolean data.

Serializes to "true" or "false".

Everything true in perl and not "false" is deserialized as true.

Returns true/false in boolean context.

Returns 1 / 0 in numeric context.

SOAP::WSDL::XSD::Typelib::Builtin::byte

byte integer objects.

SOAP::WSDL::XSD::Typelib::Builtin::date

date values are automatically converted into XML date strings during setting:

 YYYY-MM-DD+zz:zz

The time zone is set to the local time zone if not included.

All input variants supported by Date::Parse are supported. You may even pass in dateTime strings - the time part will be ignored. Note that set_value is around 100 times slower when setting non-XML-time strings

SOAP::WSDL::XSD::Typelib::Builtin::dateTime

dateTime values are automatically converted into XML dateTime strings during setting:

 YYYY-MM-DDThh:mm:ss.nnnnnnn+zz:zz

The optional nanoseconds parts is excluded in converted values, as it would always be 0.

All input variants supported by Date::Parse are supported. Note that set_value is around 100 times slower when setting non-XML-time strings

SOAP::WSDL::XSD::Typelib::Builtin::decimal

decimal is the base of all non-float numbers

SOAP::WSDL::XSD::Typelib::Builtin::double

SOAP::WSDL::XSD::Typelib::Builtin::duration

SOAP::WSDL::XSD::Typelib::Builtin::ENTITY

SOAP::WSDL::XSD::Typelib::Builtin::float

SOAP::WSDL::XSD::Typelib::Builtin::gDay

SOAP::WSDL::XSD::Typelib::Builtin::gMonth

SOAP::WSDL::XSD::Typelib::Builtin::gMonthDay

SOAP::WSDL::XSD::Typelib::Builtin::gYear

SOAP::WSDL::XSD::Typelib::Builtin::gYearMonth

SOAP::WSDL::XSD::Typelib::Builtin::hexBinary

SOAP::WSDL::XSD::Typelib::Builtin::ID

SOAP::WSDL::XSD::Typelib::Builtin::IDREF

SOAP::WSDL::XSD::Typelib::Builtin::IDREFS

List of SOAP::WSDL::XSD::Typelib::Builtin::IDREF objects.

Derived by SOAP::WSDL::XSD::Typelib::Builtin::list.

SOAP::WSDL::XSD::Typelib::Builtin::int

SOAP::WSDL::XSD::Typelib::Builtin::integer

SOAP::WSDL::XSD::Typelib::Builtin::language

SOAP::WSDL::XSD::Typelib::Builtin::list

SOAP::WSDL::XSD::Typelib::Builtin::long

SOAP::WSDL::XSD::Typelib::Builtin::Name

SOAP::WSDL::XSD::Typelib::Builtin::NCName

SOAP::WSDL::XSD::Typelib::Builtin::negativeInteger

SOAP::WSDL::XSD::Typelib::Builtin::nonNegativeInteger

SOAP::WSDL::XSD::Typelib::Builtin::nonPositiveInteger

SOAP::WSDL::XSD::Typelib::Builtin::normalizedString

SOAP::WSDL::XSD::Typelib::Builtin::NOTATION

SOAP::WSDL::XSD::Typelib::Builtin::positiveInteger

SOAP::WSDL::XSD::Typelib::Builtin::QName

SOAP::WSDL::XSD::Typelib::Builtin::short

SOAP::WSDL::XSD::Typelib::Builtin::string

SOAP::WSDL::XSD::Typelib::Builtin::time

time values are automatically converted into XML time strings during setting:

 hh:mm:ss.nnnnnnn+zz:zz
 hh:mm:ss+zz:zz

The time zone is set to the local time zone if not included. The optional nanoseconds part is not included in converted values, as it would always be 0.

All input variants supported by Date::Parse are supported. You may even pass in dateTime strings - the date part will be ignored. Note that set_value is around 100 times slower when setting non-XML-time strings

SOAP::WSDL::XSD::Typelib::Builtin::token

SOAP::WSDL::XSD::Typelib::Builtin::unsignedByte

SOAP::WSDL::XSD::Typelib::Builtin::unsignedInt

SOAP::WSDL::XSD::Typelib::Builtin::unsignedLong

SOAP::WSDL::XSD::Typelib::Builtin::unsignedShort

CAVEATS

  • set_value

    In contrast to Class::Std-generated mutators (setters), set_value does not return the last value.

    This is for speed reasons: SOAP::WSDL never needs to know the last value when calling set_calue, but calls it over and over again...

BUGS AND LIMITATIONS

  • Thread safety

    SOAP::WSDL::XSD::Typelib::Builtin uses Class::Std::Storable which uses Class::Std. Class::Std is not thread safe, so SOAP::WSDL::XSD::Typelib::Builtin is neither.

  • XML Schema facets

    No facets are implemented yet.

AUTHOR

Replace whitespace by @ in e-mail address.

 Martin Kutter E<gt>martin.kutter fen-net.deE<lt>

Licenxe

Copyright 2004-2007 Martin Kutter.

This library is free software, you may distribute/modify it under the same terms as perl itself