Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite code of EndnoteXmlImporter avoid JAXB #9538

Closed
koppor opened this issue Jan 6, 2023 · 0 comments · Fixed by #9880
Closed

Rewrite code of EndnoteXmlImporter avoid JAXB #9538

koppor opened this issue Jan 6, 2023 · 0 comments · Fixed by #9880
Labels
import type: code-quality Issues related to code or architecture decisions

Comments

@koppor
Copy link
Member

koppor commented Jan 6, 2023

The code of org.jabref.logic.importer.fileformat.EndnoteXmlImporter is well-written, but relies on JAXB. It should be rewritten using StAX-Parser and thus getting rid of a JAXB dependency.

The code reads like we do not hit polymorphism in XMLElements (which is not supported by JAXB. See FasterXML/jackson-modules-base#127).

Example method:

/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java#L177

    private BibEntry parseRecord(Record endNoteRecord) {

See /src/main/java/org/jabref/logic/importer/fileformat/MedlineImporter.java#L52 for some code hints.

Similar to #9673, the gradle build target generateEndnoteSource can be removed and the xsd file be removed from the source repository.

Negleted Implementation Option

Thus, it seems to be "just" to include the dependency to jackson module jakarta-xmlbind and to use Jackson's XMLMapper. Code examples are at https://stackify.com/java-xml-jackson/.

@koppor koppor added type: code-quality Issues related to code or architecture decisions import labels Jan 6, 2023
@koppor koppor changed the title Rewrite code of EndnoteXmlImporter to Jackson Rewrite code of EndnoteXmlImporter avoid JAXB Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import type: code-quality Issues related to code or architecture decisions
Projects
Development

Successfully merging a pull request may close this issue.

1 participant