Ubuntu Manpages

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 => 'USMARC');
    my $exporter = Catmandu->exporter('MARC', file => "marc.xml", type => 'XML' );
    $exporter->add($importer);
    $exporter->commit;

Create a new Catmandu::Exporter to serialize MARC record into XML. Provide the path of a $file to write exported records to. Optionally the following parameters can be specified:

        record : the key containing the marc record (default: 'record')
        record_format : optionally set to 'MARC-in-JSON' when the input format is in MARC-in-JSON
        collection : add a marc:collection header when true (default: true)
        xml_declaration : add a xml declaration when true (default: true)
        skip_empty_subfields : skip fields which don't contain any data (default: false)

All the Catmandu::Exporter methods are inherited.

Catmandu::Exporter