HTTP::...etadata(3pm)

πŸ“¦
version 4.13 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 the generate() method, then $dom must be a XML_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