X hits on this document

440 views

0 shares

1 downloads

0 comments

135 / 142

An Introduction to the Search/Retrieve URL Service (SRU)

$response . $response . $response . $response .

"info:srw/schema/1/dc-v1.1</recordSchema>\n"; = "<recordPacking>xml</recordPacking>\n"; = "<recordData>\n"; = "<dc>\n"; = "<title>" .

&amp;escape_entities($record->Property('title')) "</title>\n";

.

  • #

    check for and process uri

if ($record->Property ('url'))

{

$response .= "<identifier>" . &amp;escape_entities($record->Property('url')) "</identifier>\n"

.

}

  • #

    get and process holdings

my

$holding

=

$record->Property

('holding');

my @holdings = split (/\|/, foreach my $h (@holdings) {

$holding);

$response .= '<coverage>'

. &amp;escape entities($h)

.

"</coverage>\n"

_

}

  • #

    clean up

$response . $response . $response .

= "</dc>\n"; = "</recordData>\n"; = "</record>\n";

  • #

    increment the pointer and check

$p++; last if ($input->param('maximumRecords') == $p);

}

  • #

    close records

$response .

= "</records>\n";

}

  • #

    close response

$response .

= "</searchRetrieveResponse>\n";

  • #

    return it

return $response;

}

The result is an XML stream looking much like this:

<?xml version='1.0' ?> <?xml-stylesheet type='text/xsl' href='etc/search.xsl' ?> <searchRetrieveResponse>

<version>1.1</version> <numberOfRecords>2</numberOfRecords> <records>

127

Document info
Document views440
Page views446
Page last viewedThu Dec 08 12:12:51 UTC 2016
Pages142
Paragraphs3126
Words34660

Comments