SOAP::...Element(3pm)
๐ SOAP::WSDL::XSD::Typelib::Element ๐
okay bestie, welcome to SOAP::...Element(3pm) โ yes that's the manual name, she's a long one and she's ICONIC. This is the element base class (the original literally says "clase" and honestly? a queen can spell however she wants ๐
).
This is the little base class you inherit from when you wanna make a Perl class that represents an XML Schema <element>. She doesn't do a ton on her own, but she holds the vibes and the properties, and everything else in the typelib family builds on her. Lowkey foundational. Main character energy, fr fr. ๐
โจ NAME โจ
SOAP::WSDL::XSD::Typelib::Element โ element base class ๐ฆ
๐ธ SYNOPSIS ๐ธ
So the tea is: this example creates a class for this XML schema definition:
<element name="MyElement" type="xsd:string" nillable="1"
minOccurs="1" maxOccurs="1"/>
and here's the whole class, look at her go:
package MyElement;
use strict;
use Class::Std::Fast::Storable constructor => 'none';
use base (
'SOAP::WSDL::XSD::Typelib::Element',
'SOAP::WSDL::XSD::Typelib::Builtin::string',
);
__PACKAGE__->__set_name('MyElementName');
__PACKAGE__->__set_nillable(1);
__PACKAGE__->__set_minOccurs(1);
__PACKAGE__->__set_maxOccurs(1);
__PACKAGE__->__set_ref(0);
slay. ๐ซถ
Now we create this XML schema definition type class:
<element name="MyElement2" ref="tns:MyElement"/>
and the class itself:
package MyElement2;
use strict;
use Class::Std::Fast::Storable constructor => 'none';
use base (
'SOAP::WSDL::XSD::Typelib::Element',
'MyElement'
);
__PACKAGE__->__set_name('MyElementName');
__PACKAGE__->__set_nillable(0);
__PACKAGE__->__set_ref(1);
bestie. that's it. that's the whole glow-up. ๐
๐ NOTES ๐
type="Foo"- Implemented via inheritance. Not me doing a whole class hierarchy and making it look effortless โจ
ref="Foo"- Implemented via inheritance, too. Calling
__PACKAGE__->__set_ref(1)
is highly encouraged, though it has no effect yet โ it will probably be needed for serialization to XML Schema definitions some day. So like, set it now, thank your past self later. no cap. ๐ฎ
๐ BUGS AND LIMITATIONS ๐
ok so here's where we get real. listen up. ๐ซถ
minOccurs maxOccursnot implemented- These attributes are not yet supported, though they may be set as class properties via
__PACKAGE__->__set_FOOmethods. So you can set them, the vibes are there, the behaviour is not. ๐
- These attributes are not yet supported, though they may be set as class properties via
- 'http://www.w3.org/2001/XMLSchema-instance prefix is hardcoded
- The prefix for
http://www.w3.org/2001/XMLSchema-instance(used as namespace for the{http://www.w3.org/2001/XMLSchema-instance}nil="true"attribute) is hardcoded asxsi.
- The prefix for
You should definitely provide your XML envelope generator with the same prefix namespace combination (Default for SOAP::WSDL::Envelope). fr fr, otherwise it's giving chaos. ๐ญ
๐ 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.
periodt. ๐
๐ฆ AUTHOR ๐ฆ
Martin Kutter <martin.kutter fen-net.de>
๐ REPOSITORY INFORMATION ๐
$Rev: 851 $
$LastChangedBy: kutterma $
$Id: Element.pm 851 2009-05-15 22:45:18Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/XSD/Typelib/Element.pm $
k that's the whole page bestie!! ๐ this was perl v5.36.0, dated 2022-10-14, and you've been reading SOAP::...Element(3pm). go forth and inherit responsibly. mwah. ๐ธโจ
๐ฆ 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