Bug 5639 (MT #3605) Fix escaping in ILSDI
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 2c88e1e0f8)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
cb0862db67
commit
8a6278251e
|
|
@ -193,15 +193,12 @@ sub GetRecords {
|
|||
# Get the biblioitem from the biblionumber
|
||||
my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0];
|
||||
if ( not $biblioitem->{'biblionumber'} ) {
|
||||
$biblioitem = "RecordNotFound";
|
||||
$biblioitem->{code} = "RecordNotFound";
|
||||
}
|
||||
|
||||
# We don't want MARC to be displayed
|
||||
delete $biblioitem->{'marc'};
|
||||
|
||||
# nor the XML declaration of MARCXML
|
||||
$biblioitem->{'marcxml'} =~ s/<\?xml version="1.0" encoding="UTF-8"\?>//go;
|
||||
|
||||
# Get most of the needed data
|
||||
my $biblioitemnumber = $biblioitem->{'biblioitemnumber'};
|
||||
my @reserves = GetReservesFromBiblionumber( $biblionumber, undef, undef );
|
||||
|
|
@ -224,8 +221,6 @@ sub GetRecords {
|
|||
$biblioitem->{'reserves'}->{'reserve'} = $reserves[1];
|
||||
$biblioitem->{'issues'}->{'issue'} = $issues;
|
||||
|
||||
map { $biblioitem->{$_} = encode_entities( $biblioitem->{$_}, '&' ) } grep( !/marcxml/, keys %$biblioitem );
|
||||
|
||||
push @records, $biblioitem;
|
||||
}
|
||||
|
||||
|
|
@ -256,18 +251,16 @@ sub GetAuthorityRecords {
|
|||
return { code => 'UnsupportedSchema' };
|
||||
}
|
||||
|
||||
my $records;
|
||||
my @records;
|
||||
|
||||
# Let's loop over the authority IDs
|
||||
foreach my $authid ( split( / /, $cgi->param('id') ) ) {
|
||||
|
||||
# Get the record as XML string, or error code
|
||||
my $record = GetAuthorityXML($authid) || "<record><code>RecordNotFound</code></record>";
|
||||
$record =~ s/<\?xml(.*)\?>//go;
|
||||
$records .= $record;
|
||||
push @records, GetAuthorityXML($authid) || { code => 'RecordNotFound' };
|
||||
}
|
||||
|
||||
return $records;
|
||||
return { record => \@records };
|
||||
}
|
||||
|
||||
=head2 LookupPatron
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@
|
|||
<biblioitemnumber>1</biblioitemnumber>
|
||||
<isbn>9782862749198</isbn>
|
||||
<marcxml>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<record
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
|
||||
|
|
@ -208,6 +209,7 @@
|
|||
<biblioitemnumber>2</biblioitemnumber>
|
||||
<isbn>9782265078031</isbn>
|
||||
<marcxml>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<record
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
|
||||
|
|
@ -316,41 +318,39 @@
|
|||
ilsdi.pl?service=GetAuthorityRecords&id=1+2+99999
|
||||
</a>
|
||||
<h4>Example Response</h4>
|
||||
<pre><?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<pre><xml version="1.0" encoding="UTF-8">;
|
||||
<GetAuthorityRecords>
|
||||
<record>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<record
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
|
||||
xmlns="http://www.loc.gov/MARC21/slim">
|
||||
<leader>00126nx j2200073 4500 </leader>
|
||||
<leader>00182 2200085 4500</leader>
|
||||
<controlfield tag="001">1</controlfield>
|
||||
<datafield tag="250" ind1=" " ind2=" ">
|
||||
<subfield code="a">TECHNIQUE</subfield>
|
||||
<datafield tag="200" ind1=" " ind2=" ">
|
||||
<subfield code="a">Hugo</subfield>
|
||||
<subfield code="b">Victor</subfield>
|
||||
</datafield>
|
||||
<datafield tag="801" ind1=" " ind2=" ">
|
||||
<subfield code="a">France</subfield>
|
||||
<subfield code="b">Nimes</subfield>
|
||||
<subfield code="c">2010/04/13</subfield>
|
||||
</datafield>
|
||||
<datafield tag="100" ind1=" " ind2=" ">
|
||||
<subfield code="a">20071210afrey50 ba0</subfield>
|
||||
<subfield code="a">20100413 50 </subfield>
|
||||
</datafield>
|
||||
<datafield tag="152" ind1=" " ind2=" ">
|
||||
<subfield code="b">NC</subfield>
|
||||
<subfield code="b">NP</subfield>
|
||||
</datafield>
|
||||
</record>
|
||||
<record
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd"
|
||||
xmlns="http://www.loc.gov/MARC21/slim">
|
||||
<leader>00130nx j2200073 4500 </leader>
|
||||
<controlfield tag="001">2</controlfield>
|
||||
<datafield tag="250" ind1=" " ind2=" ">
|
||||
<subfield code="a">CHEMIN DE FER</subfield>
|
||||
</datafield>
|
||||
<datafield tag="100" ind1=" " ind2=" ">
|
||||
<subfield code="a">20071210afrey50 ba0</subfield>
|
||||
</datafield>
|
||||
<datafield tag="152" ind1=" " ind2=" ">
|
||||
<subfield code="b">NC</subfield>
|
||||
</datafield>
|
||||
</record>
|
||||
<record>RecordNotFound</record>
|
||||
<record>
|
||||
<code>RecordNotFound</code>
|
||||
</record>
|
||||
<record>
|
||||
<code>RecordNotFound</code>
|
||||
</record>
|
||||
</GetAuthorityRecords></pre>
|
||||
|
||||
[% ELSIF ( LookupPatron ) %]
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@ print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8');
|
|||
print XMLout(
|
||||
$out,
|
||||
noattr => 1,
|
||||
noescape => 1,
|
||||
nosort => 1,
|
||||
xmldecl => '<?xml version="1.0" encoding="UTF-8" ?>',
|
||||
RootName => $service,
|
||||
|
|
|
|||
Loading…
Reference in New Issue