DOKK / manpages / debian 12 / libcatmandu-marc-perl / Catmandu::Exporter::MARC::XML.3pm.en
Catmandu::Exporter::MARC::XML(3pm) User Contributed Perl Documentation Catmandu::Exporter::MARC::XML(3pm)

Catmandu::Exporter::MARC::XML - Exporter for MARC records to MARCXML

    # From the command line
    $ catmandu convert MARC to MARC --type XML < /foo/data.mrc
    # From Perl
    use Catmandu;
    my $importer = Catmandu->importer('MARC', file => "/foo/bar.mrc" , type => 'ISO');
    my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'XML' );
    $exporter->add($importer);
    $exporter->commit;

This Catmandu::Exporter::MARC serializes MARC records as XML.

Write output to a local file given by its path or file handle. Alternatively a scalar reference can be passed to write to a string and a code reference can be used to write to a callback function.
Write the output to an IO::Handle. If not specified, Catmandu::Util::io is used to create the output handle from the "file" argument or by using STDOUT.
An ARRAY of one or more fixes or file scripts to be applied to exported items.
the key containing the marc record (default: 'record')
Optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON
add a marc:collection header when true (default: true)
add a xml declaration when true (default: true)
skip fields which don't contain any data (default: false)
pretty-print XML

See Catmandu::Exporter, Catmandu::Addable, Catmandu::Fixable, Catmandu::Counter, and Catmandu::Logger for a full list of methods.

Catmandu::Importer::MARC::XML

2022-09-27 perl v5.34.0