DOKK / manpages / debian 12 / libcatmandu-sru-perl / Catmandu::Importer::SRU::Parser::struct.3pm.en
Catmandu::Importer::SRU::Parser::struct(3pm) User Contributed Perl Documentation Catmandu::Importer::SRU::Parser::struct(3pm)

Catmandu::Importer::SRU::Parser::struct - transform SRU responses into structured XML records

    my $importer = Catmandu::Importer::SRU->new(
        base   => $base,
        query  => $query,
        parser => 'struct'
    );

Each SRU response record will be transformed into order-preserving, structured XML as defined by XML::Struct.

Options of XML::Struct::Reader are not supported. As workaround wrap the reader as following, if needed:

    my $reader = XML::Struct::Reader->new( %options );
    my $importer = Catmandu::Importer::SRU->new(
        base   => $base,
        query  => $query,
        parser => sub {
            $reader->readDocument(
                XML::LibXML::Reader->new( string => $_[0]->{recordData} )
            );
        },
    );

Jakob Voss "voss@gbv.de"

2021-09-02 perl v5.32.1