-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
EndNote .xml import to JabRef: PDF links are not imported correctly. #6199
Comments
Relevant code: jabref/src/main/java/org/jabref/logic/importer/fileformat/EndnoteXmlImporter.java Lines 263 to 268 in 06e3b72
|
@tobiasdiez , thank you for the hint for the relevant code. I am working on a fix but have an addition question. Should I post directly here, or can I send you an email? |
@archeaopteryx Please ask here so we all can help. Best is to create a draft PR and then ask a specific question about the code |
@Siedlerchr , thank you for the advice. My naive approach would be to change the behavior of the url class referenced when defining the unmarshaller context, but that isn't possible since the context is defined by generated files. Am I missing a better solution? And, if not, is it possible for me to change the generated files? |
I came across this issue and it's inded a problem of the generated unmarshaller. I am not an expert in xml and those schema stuff. But from my opinion it should be necessary to adjust the xsd schema to add some kind of content attribute for the url attribute to represent the text without a style.
The xsd file is here: |
I am currently working on this issue, but I get a little lost now. Could you give me some hints or start points on that issue @Siedlerchr? |
@Aloofwisdom Thanks for your interest. JabRef uses the xjc tool (which uses jaxb) to automatically generate java classes from an xsd/xml schema (see the gradle task generateSource). The problem is that in the XSD defintion the element To ease your work, I already adjusted the xsd file for you. Replace the section in the Then you can adjust the method in the java code @tobiasdiez showed above to take the new fact into account. <xs:element name="url">
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element minOccurs="0" ref="style" />
</xs:sequence>
<xs:element name="url" type="xs:string" />
</xs:choice>
<xs:attribute name="has-ut">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="yes" />
<xs:enumeration value="no" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ppv-app" />
<xs:attribute name="ppv-ref">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="yes" />
<xs:enumeration value="no" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ppv-ut" />
</xs:complexType>
</xs:element> |
@Siedlerchr Your illustration is pretty clear, thanks. I will make a pull request as soon as I finish. |
…imported correctly. (JabRef#6199)
…imported correctly. (JabRef#6199)
…oid null check. Co-authored-by: Christoph <siedlerkiller@gmail.com>
Since list would be init with Collections.emptyList() if get Optional.empty().
…imported correctly. (JabRef#6199)
201e022 Update trends-journals.csl (#6224) 46e6eed Update nottingham-trent-university-library-harvard.csl (#6220) 684bb48 Update politix.csl (#6199) c484b0b Update mcgill-fr.csl (#6198) cbcf2f2 Update mary-ann-liebert-vancouver.csl (#6218) 47174f0 Create journal-of-dairy-research.csl (#6195) fdd1eac Update harvard-anglia-ruskin-university.csl (#6196) 9e384d6 Create estonian-journal-of-earth-sciences.csl (#6194) afba9b7 Delete moore-theological-college.csl as per university (#6197) 644549f Create acta-medica-philippina.csl (#6192) 6566114 Update rassegna-degli-archivi-di-stato.csl (#6186) 3509a2f Update universidade-federal-de-sergipe-departamento-de-engenharia-de-… (#6187) de4845f Update mary-ann-liebert-vancouver.csl (#6213) 16828b6 Update ucl-university-college-apa.csl (#6172) c08613b Update ucl-university-college-harvard.csl (#6173) 028bad4 Create sociologia-ruralis.csl (#6170) 77d428c Update journal-of-plankton-research.csl (#6169) 92e1022 Update and rename dependent/journal-of-the-national-cancer-institute.… (#6168) 120efb1 Update journal of hearing science e503477 Create new-harts-rules-the-oxford-style-guide-author-date.csl (#6163) 49ab318 Create the-depositional-record.csl (#6159) f4f6920 Update and rename laser-and-photonics-reviews.csl to dependent/laser-… (#6165) d8ca4bc Update united-states-international-trade-commission.csl (#6162) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 201e022
JabRef version <JabRef 5.0--2020-03-06--2e6f433
Windows 10 10.0 amd64
Java 13.0.2>
When importing an EndNote library in .xml format into JabRef, the PDF attachment links are not imported into JabRef correctly.
Steps to reproduce the behavior:
I followed instructions under "Importing an EndNote library into JabRef" at https://www.mcgill.ca/library/files/library/jabref_guide_2016.pdf, and exported the EndNote library as an .xml file (attached here as file "My EndNote Library-Converted_xml.txt") . See below snapshot (attached here as file "EndNote Export settings = xml.PNG") showing the export configuration of EndNote version X9.3.1 (Bld 13758).
I then imported the EndNote .xml library file into JabRef version 5.0.
The EndNote .xml library is imported into JabRef; however, the PDF file attachments are not imported automatically.
It appears this is a bug because JabRef expects the pdf url to be encapsulated in a
style
span as this is the case for the other urls. As a temporary workaround, you can add the <style> ... </style> tag around the filename.pdf (i.e., filename.pdf --> <style> filename.pdf </style>) yourself for the moment; this should work semi-automatically via a "search and replace" in your favorite text editor. Also, remember to replace the "internal-pdf://" before the filename.pdf with the correct path in your computer (e.g., "internal-pdf://path_folder1/filename.pdf" --> "C:/EndNote/PDFs_Folder/path_folder1/filename.pdf" in Windows, etc.).My EndNote Library-Converted_xml.txt
Log File
The text was updated successfully, but these errors were encountered: