Commit 1169a243 authored by Niels Erik G. Nielsen's avatar Niels Erik G. Nielsen
Browse files

Fix recent bug-fix for original record

parent 29badf1d
......@@ -43,7 +43,13 @@ public class MarcXMLToJson {
Element metadata = (Element)topRecord.getElementsByTagName("metadata").item(0);
record = (Element) metadata.getElementsByTagName("record").item(0);
} else if (root.getTagName().equals("record")) {
record = root;
NodeList recordsEmbeddedInRecord = root.getElementsByTagName("record");
if (recordsEmbeddedInRecord != null && recordsEmbeddedInRecord.getLength()==1) {
// e.g. a MARC record embeddded in OAI-PMH record
record = (Element) recordsEmbeddedInRecord.item(0);
} else {
record = root;
}
} else if (root.getTagName().equals("collection")) {
NodeList records = root.getElementsByTagName("record");
if (records != null && records.getLength()==1) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment