metafacture-core icon indicating copy to clipboard operation
metafacture-core copied to clipboard

Make encode-marc21 more resilient if order is not correct

Open TobiasNx opened this issue 1 year ago • 0 comments

When the leader comes not as first, encode-marc21 breaks: java.lang.IllegalStateException: must not be appending data fields

https://metafacture.org/playground/?flux=%22https%3A//d-nb.info/1106253078/about/marcxml%22%0A%7C+open-http%28accept%3D%22application/xml%22%29%0A%7C+decode-xml%0A%7C+handle-marcxml%0A%7C+fix%0A%7C+encode-marc21%0A%7C+print%0A%3B&fix=move_field%28%22leader%22%2C%22@leader%22%29%0Acopy_field%28%22@leader%22%2C%22leader.status%22%29%0Asubstring%28%22leader.status%22%2C%225%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.type%22%29%0Asubstring%28%22leader.status%22%2C%226%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.bibliographicLevel%22%29%0Asubstring%28%22leader.status%22%2C%227%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.typeOfControl%22%29%0Asubstring%28%22leader.status%22%2C%228%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.characterCodingScheme%22%29%0Asubstring%28%22leader.status%22%2C%229%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.encodingLevel%22%29%0Asubstring%28%22leader.status%22%2C%2217%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.catalogingForm%22%29%0Asubstring%28%22leader.status%22%2C%2218%22%2C%221%22%29%0Acopy_field%28%22@leader%22%2C%22leader.multipartLevel%22%29%0Asubstring%28%22leader.status%22%2C%2219%22%2C%221%22%29%0Aremove_field%28%22@field%22%29&active-editor=fix

encode-marc21 should not care if the order of elements is correct when entering it should though output in the correct order.

TobiasNx avatar Jun 14 '23 11:06 TobiasNx