Skip to content

Make encode-marc21 more resilient if order is not correct #492

@TobiasNx

Description

@TobiasNx

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%28transformationFile%29%0A%7C+encode-marc21%0A%7C+print%0A%3B&transformation=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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions