encode-marcxml creates invalid marc data when processing decoded-marc21 with separated leader elements.
It creates invalid marc xml data. See the leader spec here in the schema: https://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
encode-marcxml should behave in the same way as encode-marc21, if the data is seperated the encoder should combine them.
Status quo:
https://test.metafacture.org/playground/?flux=%22https%3A//raw.githubusercontent.com/metafacture/metafacture-core/master/metafacture-runner/src/main/dist/examples/read/marc21/10.marc21%22%0A%7C+open-http%0A%7C+as-lines%0A%7C+decode-marc21%0A%7C+encode-marcxml%0A%7C+print%0A%3B
decode-marc21(emitLeaderAsWhole="false")` -> encode-marcxml => the separated elements are kept:
<marc:leader>p</marc:leader>
<marc:leader>a</marc:leader>
<marc:leader>m</marc:leader>
<marc:leader> </marc:leader>
<marc:leader>a</marc:leader>
<marc:leader> </marc:leader>
<marc:leader>c</marc:leader>
<marc:leader> </marc:leader>
leader should be combined.
Originally posted by @TobiasNx in #526 (comment)