SOAP::...Builtin(3pm)
β¨ SOAP::WSDL::XSD::Typelib::Builtin β¨
okay bestie, welcome to the manual page for SOAP::...Builtin(3pm) β that's SOAP::WSDL::XSD::Typelib::Builtin to its friends π It's a User Contributed Perl Documentation page and it's literally the built-in datatype squad for XML Schema. Let's get into it π«Ά
πΈ NAME πΈ
SOAP::WSDL::XSD::Typelib::Builtin β Built-in XML Schema datatypes. no cap, that's the whole name π
π¦ DESCRIPTION π¦
The SOAP::WSDL::XSD::Typelib::Builtin hierarchy implements all builtin types from the XML schema specification. every single one. she's thorough π
All XML schema derived types inherit from SOAP::WSDL::XSD::Typelib::Builtin::anyType. that's the mother of the whole family tree, the main character fr fr π
These basic type classes are most useful when used as element or simpleType base classes.
Using SOAP::WSDL::XSD::Typelib::Builtin uses all of the builtin datatype classes. one use and the entire roster shows up to the party β¨
All builtin types feature common behaviour described below in "OVERLOADED OPERATORS". keep scrolling bestie, it's down there π
π 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"
okay yes, that last one is a whole mood π go off, $list.
π CLASS HIERARCHY π
This is the inheritance graph for builtin types. the family tree, the group chat roster, the whole thing π§
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. yes, order matters. she's picky like that π
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
- NOTATION
- string
- normalizedString
- language
- Name
- NCName
- ID
- IDREF
- IDREFS [list]
- ENTITY
- token
- NMTOKEN
- NMTOKENS [list]
look at that lineage π so organized. queen behaviour π
π OVERLOADED OPERATORS π
Overloading is implemented via Class::Std's trait mechanism. fancy, ikyk π
The following behaviours apply:
- string context β All classes use the
serializemethod for stringification. so when youprinther, that's the method doing the talking π€ - bool context β All classes derived from
anySimpleTypereturn their value in bool context. - numeric context β The
booleanclass returns0or1in numeric context.decimal,floatanddouble(and derived classes) return their value in numeric context. - arrayification (
@{}) β When accessed as a list ref, objects of all classes return a list ref with the object itself as single element.
This is most useful for writing loops without additional conversions, especially in mini-languages found in templating systems or the like, which may not natively support converting to list refs.
Instead of writing something like
my $value = $complexType->get_ELEMENT;
$value = ref $value eq 'ARRAY' ? $value : [ $value ];
for (@{ $value }) { ... }
you can just write
for (@{ $complexType->get_ELEMENT }) {...}
glow up fr fr β¨
Note that complexTypes with undef elements still return undef when accessing an undefined element, so when an element may be empty you still have to write something like:
my $value = $complexType->get_ELEMENT();
if (defined $value) {
for (@{ $value }) {
...
}
}
β οΈ bestie do NOT skip thedefinedcheck,undefwill simply not cooperate π
π Subclasses π
π SOAP::WSDL::XSD::Typelib::Builtin::anyType
Base class for all types. the ancestor, the origin story, the blueprint π
π 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.
boolean objects have a special method for deleting their value, because calling setl_value(undef) results in the value being set to false. sneaky little trap π
$obj->delete_value();
π 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 π³
When setting dates before the beginning of the epoch (negative UNIX timestamp), you should use the XML date string format for setting dates. The behaviour of Date::Parse for dates before the epoch is system dependent.
π 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 fraction of seconds (nnnnnnn) part is optional. Fractions of seconds may be given with arbitrary precision.
The fraction of seconds part 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. she's the foundation π
π 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
Tab, newline and carriage return characters are replaced by whitespace in set_value.
π 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
String values are XML-escaped on serialization.
The following characters are escaped: <, >, &.
π 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 toClass::Std-generated mutators (setters),set_valuedoes 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...
π yes bestie, it really does say set_calue up there. we keep it as-is, no edits, periodt.
π BUGS AND LIMITATIONS π
- Thread safety β
SOAP::WSDL::XSD::Typelib::BuiltinusesClass::Std::Fast::Storablewhich usesClass::Std.Class::Stdis not thread safe, soSOAP::WSDL::XSD::Typelib::Builtinis neither. π keep that in mind. - XML Schema facets β No facets are implemented yet. not yet bestie, not yet π
π«Ά AUTHOR π«Ά
Replace whitespace by @ in e-mail address.
Martin Kutter E<gt>martin.kutter fen-net.deE<lt>
β LICENSE AND COPYRIGHT β
Copyright 2004-2007 Martin Kutter.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself.
and that's the whole page bestie π you ate. this was perl v5.36.0, dated 2022-10-14, and it slays exactly as hard as it did the day it shipped ππ mwah, go write some XML π
π¦ where this page comes from
- ubuntu noble: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms