MAB2::...er::XML(3pm)
π NAME π
MAB2::Writer::XML β it's the MAB2 XML format serializer, bestie. That's the whole vibe. β¨
πΈ SYNOPSIS πΈ
Okay so MAB2::Writer::XML is a MAB2 XML serializer, periodt. Here's how you pull up:
use MAB2::Writer::XML;
my @mab_records = (
[
['001', ' ', '_', '2415107-5'],
['331', ' ', '_', 'Code4Lib journal'],
['655', 'e', 'u', 'http://journal.code4lib.org/', 'z', 'kostenfrei'],
...
],
{
record => [
['001', ' ', '_', '2415107-5'],
['331', ' ', '_', 'Code4Lib journal'],
['655', 'e', 'u', 'http://journal.code4lib.org/', 'z', 'kostenfrei'],
...
]
}
);
my $writer = MAB2::Writer::XML->new( fh => $fh, xml_declaration => 1, collection => 1 );
$writer->start();
foreach my $record (@mab_records) {
$writer->write($record);
}
$writer->end();
no cap, that's it. start, write in a loop, end. the holy trinity. π
π Arguments π
"xml_declaration"β write that XML declaration, queen. Set it to0or1. Default:0. Optional. π"collection"β wraps your records in the collection element (<datei>). Set to0or1. Default:0. Optional. π¦
Also go peek at MAB2::Writer::Handle, iykyk. π
β METHODS β
π new(file => $file | fh => $fh [, xml_declaration => 1, collection => 1, encoding => 'UTF-8'])
Yeah that's the constructor signature, copy it exactly bestie, don't freestyle it. π
πΈ start()
Writes the XML declaration and/or the start element for a collection. Main character energy, opening the show. β¨
π¦ _write_record()
(it's the internal one, it's giving behind-the-scenes π )
π end()
Writes the end element for the collection. Closing the curtain, iconic. π
π SEEALSO
MAB2::Writer::HandleCatmandu::Exporter
go read those too, fr fr. π
π AUTHOR
Johann Rolschewski <jorol@cpan.org> β the legend themselves. π«Ά
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2013 by Johann Rolschewski.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay, open source. π
okay bye bestie, this page was generated by perl v5.36.0 on 2022-12-04, and it's part of the User Contributed Perl Documentation collection β MAB2::...er::XML(3pm) out. periodt. π β¨
π¦ where this page comes from
- debian bookworm: libcatmandu-mab2-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatmandu-mab2-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-mab2-perl 0.24-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libcatmandu-mab2-perl 0.24-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms