MARC::Parser::XML(3pm)

MARC::Parser::XML3pm

Parser for marc xml records

Usage

    use MARC::Parser::XML;
    my $parser = MARC::Parser::XML->new( 't/marc.xml' );
    while ( my $record = $parser->next() ) { 
        # do something ...
    }

Overview

MARC::Parser::XML is a lightweight, fault tolerant parser for MARC XML records. Tags, indicators and subfield codes are not validated against the MARC standard. The resulting data structure is optimized for usage with the Catmandu data tool kit.

Marc

The MARC record is parsed into an ARRAY of ARRAYs:

    $record = [
            [ 'LDR', undef, undef, '_', '00661nam  22002538a 4500' ],
            [ '001', undef, undef, '_', 'fol05865967 ' ],
            ...
            [   '245', '1', '0', 'a', 'Programming Perl /',
                'c', 'Larry Wall, Tom Christiansen & Jon Orwant.'
            ],
            ...
        ];

Methods

new($file|$fh|$xml)

Configuration

"file"

Path to file with MARC XML records.

"fh"

Open filehandle for MARC XML records.

"xml"

XML string.

next()

Reads the next record from MARC input.

_decode($record)

Deserialize a raw MARC record to an ARRAY of ARRAYs.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

Johann Rolschewski <[email protected]>

License

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

From libmarc-parser-xml-perl 0.03-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.