XML::C...nclude(3pm)
π XML::Compile::XOP::Include β the whole vibe π
okay so bestie, welcome to XML::Compile::XOP::Include, straight outta the User Contributed Perl Documentation β¨ this one's a Perl module page, manual section 3pm, and it's literally all about representing one single XOP node. let's get into it π«Ά
β¨ NAME β¨
XML::Compile::XOP::Include β bestie it Represents one XOP node. that's it, that's the whole job description π
πΈ SYNOPSIS πΈ
# See also SYNOPSIS of XML::Compile::XOP
my $xop = XML::Compile::XOP->new;
my $xop_image = $xop->bytes($binary_image);
my $answer = $call->(image => $xop_image);
no cap, that's how you're supposed to touch this thing π
π¦ DESCRIPTION π¦
so what IS this? it represents one data-set that gets represented as a separate (binary) object while it's being transported. literally one. and it can ONLY be used on data fields that are base64Binary. that's the rule, periodt π₯
π¨ YOU SHOULD NOT instantiate this kind of object directly, bestie!! do NOT do it!! use the XML::Compile::XOP method to create them instead, iykyk π
the object is overloaded so it produces the contained data whenever a scalar is required β like when you call functions such as length. and the hope (hope!! π) is that the end-user lowkey doesn't see much of a difference between data that gets transported inline versus data that gets packaged separately. iconic behaviour honestly π
π METHODS π
π Constructors
XML::Compile::XOP::Include->fromMime($object)β collects the data from aHTTP::Messageobject. slay, hand it the message and it scoops the data out π«ΆXML::Compile::XOP::Include->new(%options)β okay so you have to specify either afileor abytesource. if you don't? the constructor returnsundef. rude but fair π
-Option--Default
bytes undef
cid <required>
file undef
type <required>
xmime <required>
xop <required>
bytes => STRING|SCALARβ take the data from aSTRINGof reference β¨cid => STRINGβ the Content-ID of the binary attachment πfile => FILENAME|FILEHANDLEβ take the data from the specified file πtype => MIMETYPEβ the MIME-Type of the data πxmime => VERSIONβ yep, it's a VERSION, that's the tea πΈxop => VERSIONβ also a VERSION, matching energy π
β Accessors
$obj->cid()β returns the Content-ID π«Ά$obj->content( [$byref] )β returns the content. and when$byref(a boolean) is true, the value comes back by reference instead π$obj->contentCharset()β returns the character set, as provided by theContent-Typeheader π$obj->contentType()β returns the media type that's included in theContent-Typeheader β¨$obj->string()β returns the content as a string in Perl internal encoding π
π₯ Processing
$obj->mimePart( [$headers] )β produces the message part that contains a normal mime representation of a binary file. you may hand it an initial$headers(HTTP::Headers) object, or anARRAYof headers to instantiate such an object π«Ά$obj->write($filename|$fh)β writes the content to the specifiedFILEπ$obj->xmlNode($document, $path, $tag)β the$documentis what gets used to construct the node from. the$pathis an indicator for the location of the node within the data structure (it's used in error messages, so like, for the receipts π). and the$tagis the prefixed name for the node to be created.
what comes back is an XML node to be included in the output tree π³β¨
π OVERLOAD π
overload: ""β this object stringifies to its binary content. no thoughts, just bytes, main character energy π
π SEE ALSO π
this module is part of the XML-Compile-SOAP distribution, version 3.28, built on August 01, 2022. website: http://perl.overmeer.net/CPAN/ π
π LICENSE π
Copyrights 2007-2022 by [Mark Overmeer <markov@cpan.org>]. for other contributors, see ChangeLog π«Ά
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. see http://dev.perl.org/licenses/ π
and that's the whole page bestie, written for perl v5.34.0, dated 2022-08-04 β mwah, go forth and include your XOP nodes responsibly πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-compile-soap-perl 3.28+ds-1 Β· 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