From a0f2736dd5fe07b58a4f4ca48694afa878e222bb Mon Sep 17 00:00:00 2001 From: TobiasNx <61879957+TobiasNx@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:52:16 +0200 Subject: [PATCH] Write valid leader without counting #527 Instead of just appending the incoming leader elements, this adds the static values for Pos: 00-04, 10-16, 20-23. By using `0`as default value for Pos: 00-04 and 12-16. https://github.com/metafacture/metafacture-core/issues/527#issuecomment-2076585889 --- .../main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java index 2271dafaa..9dba83d51 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlEncoder.java @@ -435,7 +435,7 @@ private void writeLeader() { if (!leader.isEmpty()) { prettyPrintIndentation(); writeTag(Tag.leader::open); - writeRaw(leader); + writeRaw("0000" + leader.substring(0, 4) + "2200000" + leader.substring(5, 7) + "4500"); // creates a valid leader without counted elements writeTag(Tag.leader::close); prettyPrintNewLine(); }