XML::C...nclude(3pm)

πŸ“¦
version 3.28 Β· 2 versions
  • 3.28 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 3.27 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 a HTTP::Message object. slay, hand it the message and it scoops the data out 🫢
  • XML::Compile::XOP::Include->new(%options) β€” okay so you have to specify either a file or a byte source. if you don't? the constructor returns undef. rude but fair πŸ’€
-Option--Default
 bytes   undef
 cid     <required>
 file    undef
 type    <required>
 xmime   <required>
 xop     <required>
  • bytes => STRING|SCALAR β€” take the data from a STRING of 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 the Content-Type header 🌈
  • $obj->contentType() β€” returns the media type that's included in the Content-Type header ✨
  • $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 an ARRAY of headers to instantiate such an object 🫢
  • $obj->write($filename|$fh) β€” writes the content to the specified FILE πŸ’…
  • $obj->xmlNode($document, $path, $tag) β€” the $document is what gets used to construct the node from. the $path is 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 $tag is 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