Bug 18683 - biblioitems.marcxml does not match MARC21slim.xsd
Summary: biblioitems.marcxml does not match MARC21slim.xsd
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: 17.05
Hardware: All Linux
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-26 18:56 UTC by casi
Modified: 2022-12-12 21:23 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description casi 2017-05-26 18:56:13 UTC
I found the following record in a Koha installation that I manage, running on a Debian server.

----

<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>[...]</leader>
  <datafield tag="999" ind1=" " ind2=" ">
    <subfield code="c">[...]</subfield>
    <subfield code="d">[...]</subfield>
  </datafield>
  <controlfield tag="001">[...]</controlfield>
  [...]

----

This does not comply with the MARC21slim.xsd Schema definition, which says:

<xsd:complexType name="recordType" id="record.ct">
	<xsd:sequence minOccurs="0">
		<xsd:element name="leader" type="leaderFieldType"/>
		<xsd:element name="controlfield" type="controlFieldType" minOccurs="0" maxOccurs="unbounded"/>
		<xsd:element name="datafield" type="dataFieldType" minOccurs="0" maxOccurs="unbounded"/>
	</xsd:sequence>
	<xsd:attribute name="type" type="recordTypeType" use="optional"/>
	<xsd:attribute name="id" type="idDataType" use="optional"/>
</xsd:complexType>

These malformed xml strings were created by Koha over the time. To localize the errors, I ran a SQL query on the database.

> select timestamp from biblioitems where marcxml like "%<datafield tag=\"999\"%<controlfield%" order by timestamp

gives 962 rows, since 24th of October 2016

Some of the marcxml fields even contain the field 999 a second time, at the end.

> select timestamp from biblioitems where marcxml like "%<datafield tag=\"999\"%<controlfield%<datafield tag=\"999\"%" order by timestamp

gives 509 rows, since 4th of January 2017
Comment 1 Tomás Cohen Arazi 2021-12-30 16:10:49 UTC
The biblioitems.marcxml column doesn't exist anymore on the current stable releases. Closing.