MAB2::Writer::XML(3pm)

MAB2::Writer::XML3pm

Mab2 xml format serializer

Usage

MAB2::Writer::XML is a MAB2 XML serializer.

    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();

Arguments

"xml_declaration"

Write XML declaration. Set to 0 or 1. Default: 0. Optional.

"collection"

Wrap records in collection element (<datei>). Set to 0 or 1. Default: 0. Optional.

See also MAB2::Writer::Handle.

Methods

new(file => $file | fh => $fh [, xml_declaration => 1, collection => 1, encoding => 'UTF-8'])

start()

Writes XML declaration and/or start element for a collection.

_write_record()

end()

Writes end element for the collection.

Seealso

MAB2::Writer::Handle, Catmandu::Exporter.

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13

Author

Johann Rolschewski <[email protected]>

From libcatmandu-mab2-perl 0.24-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.