SRU::Response::SearchRetrieve - A class for representing SRU searchRetrieve responses
## create response from the request object my $response = SRU::Response::SearchRetrieve->new( $request ); ## add records to the response foreach my $record ( @records ) { $response->addRecord( $record ); } ## print out the response as XML print $response->asXML();
SRU::Response::SearchRetrieve provides a framework for bundling up the response to a searchRetrieve request. You are responsible for generating the XML representation of the records, and the rest should be taken care of.
Returns the number of results associated with the object.
Add a SRU::Response::Record object to the response.
$response->addRecord( $r );
If you don't pass in the right sort of object you'll get back undef and $SRU::Error will be populated appropriately.
Gets or sets all the records associated with the object. Be careful with this one :) You must pass in an array ref, and expect an array ref back.
Returns the object serialized as XML.
To install SRU, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SRU
CPAN shell
perl -MCPAN -e shell install SRU
For more information on module installation, please visit the detailed CPAN module installation guide.