add underscore subfield ID for control field hack in XML write

This commit is contained in:
Jörg Prante 2023-01-26 22:41:21 +01:00
parent ccdb458698
commit 62c5a73771
2 changed files with 7 additions and 3 deletions

View file

@ -1,5 +1,5 @@
group = org.xbib group = org.xbib
name = marc name = marc
version = 2.9.15 version = 2.9.16
org.gradle.warning.mode = ALL org.gradle.warning.mode = ALL

View file

@ -348,8 +348,12 @@ public class MarcXchangeWriter extends MarcContentHandler implements Flushable,
if (field.isControl()) { if (field.isControl()) {
String value = field.getValue(); String value = field.getValue();
if (value == null || value.isEmpty()) { if (value == null || value.isEmpty()) {
// the control field is disguised as a data field, try lookup value in first subfield of " " // the control field is disguised as a data field, try lookup value in first subfield of "_"
value = field.getFirstSubfieldValue("_");
// if no value, maybe " "?
if (value == null || value.isEmpty()) {
value = field.getFirstSubfieldValue(" "); value = field.getFirstSubfieldValue(" ");
}
// still no value? Then it is some exotic like MAB with subfield "a"? // still no value? Then it is some exotic like MAB with subfield "a"?
if (value == null || value.isEmpty()) { if (value == null || value.isEmpty()) {
value = field.getFirstSubfieldValue("a"); value = field.getFirstSubfieldValue("a");