In an ideal world, there would be no malformed XML. But our world is the
real world of libraries, and while the well_formed_xml() protects
against malformed XML in Evergreen 2.0 systems, in some cases bad XML
has been able to find its way into Evergreen systems in the past.
A single biblio.record_entry row containing malformed XML in the marc
column will prevent the call to reingest URIs from succeeding. By
limiting the set of records to those with well-formed XML, we can
increase the chance of the URI reingest succeeding at the cost of more
processing time.
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
FROM asset.call_number acn
INNER JOIN asset.uri_call_number_map auricnm ON auricnm.call_number = acn.id
INNER JOIN asset.uri auri ON auri.id = auricnm.uri
+ INNER JOIN biblio.record_entry bre ON acn.record = bre.id
WHERE auri.href = auri.label
+ AND xml_is_well_formed(bre.marc)
GROUP BY acn.record
ORDER BY acn.record
) AS rec_uris