HTTP::...etadata(3pm)
π HTTP::OAI::Metadata π
okay bestie, so this is a page from the User Contributed Perl Documentation collection β it's the manual for HTTP::OAI::Metadata, and it's literally the glow-up home base for data objects that carry DOM trees around with them. π
β¨ NAME β¨
HTTP::OAI::Metadata β the base class for data objects that contain DOM trees. it's giving "parent energy", it's giving "everyone else inherits from me". πΈ
π SYNOPSIS π
here's the vibe, copy-paste ready, no notes:
use HTTP::OAI::Metadata;
$xml = XML::LibXML::Document->new();
$xml = XML::LibXML->new->parse( ... );
$md = new HTTP::OAI::Metadata();
$md->dom($xml);
$md = new HTTP::OAI::Metadata(dom=>$xml);
print $md->dom->toString;
my $dom = $md->dom(); # Return internal DOM tree
like. look at that. you can make one, you can hand it a dom, you can print it, you can grab it back. slay. π
π¦ METHODS π¦
$md->dom( [$dom] )
this one returns the XML DOM object holding the actual metadata β and optionally sets it if you pass $dom in. so it's a getter and a setter, main character behaviour fr fr. π«Ά
β οΈ heads up bestie: if you're planning on using thegenerate()method, then$dommust be aXML_DOCUMENT_NODE. no exceptions, no cap. don't be out here passing anything else and then acting surprised. π
and that's the whole page, honestly β short, sweet, iconic.
this one's from perl v5.36.0, dated 2023-09-28, and it lives in the HTTP::...etadata(3pm) manual. mwah. πβ¨
π¦ where this page comes from
- debian trixie: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu noble: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu resolute: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu stonking: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms