Skip to content

MODS export corrupts names fields #17898

Description

@Omikhleia

JabRef version

5.15 (latest release)

Operating system

GNU / Linux

Details on version and operating system

Ubuntu 24.04

Checked with the latest development build (copy version output from About dialog)

  • I made a backup of my libraries before testing the latest development version.
  • I have tested the latest development version and the problem persists

Steps to reproduce the behaviour

  1. Bibliography with multiple authors and editors and some names containing "and" (ex. "Sandra", "Sanders")
  2. Export to MODS (XML)
  3. Either re-import the output MODS as a new library or just view it in a text editor
    • Observe that exported names are split at "and" in inappropriate places
    • Observe that roles (author, editor) are absent and the editor(s) are lost

Appendix

Regarding the erroneous name splitting:

String[] authors = value.split("and");

It's a raw split at any "and" where other similar cases in the code base seem to use the more advanced AuthorList.parse()

In the same function, their's no logic to ouput the role1.

In the calling function, it also can be seen that the "editor" field is not exported.2

Example Bib(La)TeX entry
@Book{Doe2026,
  author     = {Doe, John and Smith, Sandra and Sanders, Bill},
  date       = {2026},
  title      = {Sands},
  editor     = {Flanders, Sam},
  publisher  = {Sanders Academic},
}
Exported MODS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mods:modsCollection xmlns:mods="http://www.loc.gov/mods/v3" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/standards/mods/v3/mods-3-6.xsd">
    <mods:mods ID="Doe2026">
        <mods:identifier type="citekey">Doe2026</mods:identifier>
        <mods:genre>book</mods:genre>
        <mods:name type="personal">
            <mods:namePart type="family">Doe</mods:namePart>
            <mods:namePart type="given">John</mods:namePart>
        </mods:name>
        <mods:name type="personal">
            <mods:namePart type="family"> Smith</mods:namePart>
            <mods:namePart type="given">S</mods:namePart>
        </mods:name>
        <mods:name type="personal">
            <mods:namePart type="family">ra </mods:namePart>
        </mods:name>
        <mods:name type="personal">
            <mods:namePart type="family"> S</mods:namePart>
        </mods:name>
        <mods:name type="personal">
            <mods:namePart type="family">ers</mods:namePart>
            <mods:namePart type="given">Bill</mods:namePart>
        </mods:name>
        <mods:titleInfo>
            <mods:title>Sands</mods:title>
        </mods:titleInfo>
        <mods:originInfo>
            <mods:publisher xsi:type="mods:stringPlusLanguagePlusSupplied">Sanders Academic</mods:publisher>
        </mods:originInfo>
        <mods:relatedItem type="host">
            <mods:part/>
        </mods:relatedItem>
        <mods:typeOfResource>text</mods:typeOfResource>
    </mods:mods>
</mods:modsCollection>

Footnotes

  1. The bib2xml tools from bib-utils would typically include <role><roleTerm authority="marcrelator" type="text">author</roleTerm></role> for each author. ↩

  2. Likewise, bib2xml would output editor(s) after the author(s), with the "editor" role. ↩

Activity

  1. added theissue type on Nov 22, 2026
  2. added
    status: needs-triage
    on Nov 22, 2026
  3. USC-dot commented on Nov 23, 2026

    @USC-dot
    Contributor

    Hi! I'd like to work on this issue. I can reproduce the problem and would like to investigate the name-handling logic in ModsExporter.java. Is this issue available for me to work on?

  4. added and removed
    status: needs-triage
    on Nov 23, 2026
  5. Siedlerchr commented on Nov 23, 2026

    @Siedlerchr
    Member

    Probably similar to the RIS author import/exporter issues that all split at and

  6. USC-dot commented on Nov 23, 2026

    @USC-dot
    Contributor

    Can you assign it to me then?

  7. jabref-machine commented on Nov 23, 2026

    @jabref-machine
    Collaborator

    👋 Hey @USC-dot, looks like you’re eager to work on this issue — great! 🎉 It also looks like you don't know how to assign issues to yourself. Please read our CONTRIBUTING.md to find out how. It will also guide you in other aspects of contributing to JabRef.

  8. USC-dot commented on Nov 23, 2026

    @USC-dot
    Contributor

    Ok got it

  9. USC-dot commented on Nov 23, 2026

    @USC-dot
    Contributor

    /assign-me

  10. added
    📍 Assigned
    on Nov 23, 2026
  11. jabref-machine commented on Nov 23, 2026

    @jabref-machine
    Collaborator

    👋 Hey @USC-dot, thank you for your interest in this issue! 🎉

    We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
    When using AI tools, please use them as an assistant rather than simply copying their output. See Don't paste the AI, please..
    For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.

    In case you encounter failing tests during development, please check our developer FAQs!

    Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.

    Happy coding! 🚀

  12. moved this from Normal priority to Done in Prioritizationon Nov 29, 2026
  13. github-actions commented on Nov 29, 2026

    @github-actions
    Contributor

    We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.

    For any feedback, add a comment to the pull request at #17936.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component: export-or-save📌 Pinned📍 Assigned

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions