NAME

PICA::SRUSearchParser - Parse a SRU response in XML and extract PICA+ records.

METHODS

new

Creates a new Parser. See PICA::Parser for a description of parameters to define handlers (Field and Record).

parseResponse

Parse an SRU SearchRetrieve Response given as an XML string.

counter

Get the number of read records so far.

empty

Get the number of empty records that have been read so far. By default empty records are not passed to the record handler but counted.

size

Get the total number of records in the SRU result set. The result set may be split into several chunks.

resultSetId

Get the SRU resultSetId.

PRIVATE HANDLERS

Do not directly call this methods!

_start_handler

SAX handler for XML start tag. On PICA+ records this calls the start handler of PICA::XMLParser, outside of records it parses the SRU response.

_end_handler

SAX handler for XML end tag. On PICA+ records this calls the end handler of PICA::XMLParser.

_char_handler

SAX handler for XML character data. On PICA+ records this calls the character data handler of PICA::XMLParser.

TODO

There seems to be a memory leak in the new() method, try while(1) { my $parser = PICA::SRUSearchParser->new(); }

A method to get the parameters in the header (numberOfRecords, resultSetId...) is needed to get the number of records before actually parsing the result.

Following requests of next records it not implemented yet.

There is no check whether the SRU server supports pica format.

Better error handling would be nice to skip invalid records but parse the rest.

We need test cases.

AUTHOR

Jakob Voss <jakob.voss@gbv.de>

LICENSE

Copyright (C) 2007 by Verbundzentrale Goettingen (VZG) and Jakob Voss

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.