Import from Clipboard may fail with ChatGPT XML code

I have run into an issue with Zotero 10.0.1 failing to import from clipboard but importing successfully from the XML file. The file is a publicly available PDF from the American Heart Association entitled "The Facts on Fats: 50 Years of American Heart Association Dietary Fats Recommendations," published in June 2015.

The browser import imported the file but did not retain any of the metadata from the file. I used ChatGPT to generate Zotero RDF code to import it. Once it did that, I copied the code and used "Import from Clipboard." I got the error message "The selected file is not in a supported format." I then downloaded the code as an RDF file and tried File>Import of the RDF. The reference imported cleanly into Zotero. No errors were observed upon inspection of the metadata.

Further testing and code inspection revealed that the ChatGPT-generated code in its response contained a blank line before the XML declaration. This blank line was not present in the RDF file. When I copied the code from the response, pasted it to Notepad++, removed the blank line, and then copied that code to the clipboard, the "Import from Clipboard" operation worked as expected.

I have not determined whether the blank line originated in ChatGPT's displayed code or was introduced during the copying operation. However, removing it resolved the import failure.

I am posting this in case someone else runs into this problem with the "Import from Clipboard" function.
Sign In or Register to comment.