def _create_marc(records_xml): """Creates MARC from MARCXML. @param records_xml: MARCXML containing information about the records @return: string containing information about the records in MARC format """ aleph_marc_output = "<pre>" records = bibrecord.create_records(records_xml) for (record, status_code, list_of_errors) in records: # The system number is in field 970a # By this reason it should exist in the MARC XML # otherwise it will be None in the output ALEPH marc sysno_options = {"text-marc":0} sysno = xmlmarc2textmarclib.get_sysno_from_record(record, sysno_options) if sysno == None: sysno = "" options = {"aleph-marc":1, "correct-mode":1, "append-mode":0, "delete-mode":0, "insert-mode":0, "replace-mode":0, "text-marc":0} aleph_record = xmlmarc2textmarclib.create_marc_record(record, sysno, options) aleph_marc_output += aleph_record aleph_marc_output += "</pre>" return aleph_marc_output
def _create_marc(self, records_xml): """Creates MARC from MARCXML. @param records_xml: MARCXML containing information about the records @return: string containing information about the records in MARC format """ aleph_marc_output = "" records = bibrecord.create_records(records_xml) for (record, status_code, list_of_errors) in records: sysno_options = {"text-marc":1} sysno = xmlmarc2textmarclib.get_sysno_from_record(record, sysno_options) options = {"aleph-marc":0, "correct-mode":1, "append-mode":0, "delete-mode":0, "insert-mode":0, "replace-mode":0, "text-marc":1} aleph_record = xmlmarc2textmarclib.create_marc_record(record, sysno, options) aleph_marc_output += aleph_record return aleph_marc_output