OJS3 issue import sample xml file needed

I want to import back issues to OJS3 journal. As far as I understood the file should contain the pdf article converted to base64. Is there a way to make the xml file to contain pdf url rather than base64 embed code?
Could you provide me a sample import file please?

Hi @euser,

I don’t have a sample handy – but instead of using the embed element to embed the file contents with base64 encoding, use the href element to define a remote URL. Off the top of my head, the href element supports a relative path when doing a command-line import, though I may be wrong on that count. Make sure you validate the XML against the schema before you import!

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Dear Staff member,
thank you for your kind response.
I wrote a sample 1 article issue and tried to import. It did not work out. Could you make correction on it and send me back. I am really in need of this. Please see it attached:

The error message I received upon importing is as follows:
Validation errors:

Opening and ending tag mismatch: cover line 20 and issue_covers
error parsing attribute name
attributes construct error
Couldn’t find end of Start Tag article line 27
expected ‘>’
Opening and ending tag mismatch: articles line 26 and article
expected ‘>’
Opening and ending tag mismatch: issue_covers line 19 and article
expected ‘>’
Opening and ending tag mismatch: issue line 2 and article
Extra content at the end of the document
The document has no document element.

In your screenshot, you have two lines that start out as:
<article xmlns...
The first of these is missing a closing delimiter (>). It looks this incomplete line is unintentional.

Dear asmecher,
I did rewrite the code for importing issue with href instead of embed. I suppose OJS3 does not support this. The error I received during the import is:

Element ‘{http://pkp.sfu.ca}file’: This element is not expected. Expected is one of ( {http://pkp.sfu.ca}name, {http://pkp.sfu.ca}href, {http://pkp.sfu.ca}embed ).

Is there a solution
Thank you

Hi @euser,

It sounds like your markup doesn’t match the schema. Have you tried validating the XML using e.g. an XML editor or something like xmllint before importing it?

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you for reminding the validation. I did. OJS3 imports an issue now. Only, there is still a problem. The PDF file itself is not imported, while every other element is imported.
Could you please check and give me feedback.
Thank you in advance.

I think we had a similar problem. We are currently trying to migrate an existing journal to OJS3 via the native XML-import plugin. If i get it right you just want that readers can download the fulltext on the journal homepage.

This is our approach. In the submission_file section we just encode a dummy textfile, because no one except the journal editors will see this file.

<submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="submission" id="92" xsi:schemaLocation="http://pkp.sfu.ca native.xsd"><revision number="1" genre="Artikeltext" filename="uploaddummy.txt" viewable="true" date_uploaded="2000-01-01" date_modified="2000-01-01" filesize="11" filetype="text/plain" user_group_ref="Zeitschriftenverwalter/in" uploader="OJS"><name locale="de_DE">OJS, Zeitschriftenverwalter/in, uploaddummy.txt</name><embed encoding="base64">VXBsb2FkZHVtbXk=</embed></revision></submission_file>

But in the article_galley section we just transmit a fixed path and a variable filename for each article. You have to use the tag remote src to transmit the path and not embed encoding:

<article_galley xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" approved="false" xsi:schemaLocation="http://pkp.sfu.ca native.xsd"><id type="internal" advice="ignore">92</id><name locale="en_US">PDF</name><seq>0</seq><remote src="http://pcubtestrg1.ub.uni-giessen.de/ojs/oldfiles/06_Review_Tutic2.pdf"/></article_galley>

This way you can circumvent to encoding of the file.

1 Like

It worked like a charm :slight_smile:
Thank you very much “florianruckelshausen”
You saved me a lot of time.
I am surprised why any of the staff members could not be this much helpful.

All the best

Hi all,

Thanks, @florianruckelshausen!

@euser, check your expectations – we are a small team, providing you with free software and free support, and are continuing to do so over the Christmas holidays.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Dear @asmecher
Thank you very much too.
You did help a lot as well by suggesting to verify xml files, which helped to form the issue import xml file.
To make a humble contribution, I am ready to provide the sample issue xml file if anyone needs.
Have a Merry Christmass and a Happy new year.
Regards

1 Like

Hi @euser,

Happy holidays to you too. I’m sure many users would find more sample XML useful.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi,
as I have the same problem, migrating form a paper journal to online one, I will really appreciate a sample xml (ideally an issue with an article). I’m not fond of xml and the documentation is lacking a more complete example.
Thx in advance

Hi @farth,

What version of OJS are you using? Have you found the example XML in the codebase?

Regards,
Alec Smecher
Public Knowledge Project Team

HI,
I use OJS 3.0.1. I have found the sample.xml file but it is not as complete as I would have expected, just one article and no mention of the galley stuff. The image example some comments above is more what I was looking for and is very useful but if I can have it in xml format, I could work on it and use it as a template for a python script to generate all my issues for archive.

Regards

Hi @farth,

There’s also this example that’s part of the Lens reader plugin; you might find it more useful.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
oh yes this look like a perfect sample. I have a question from what I have read above about article_galley and submission file: do i need to specify both of them or article_galley is enough ? TO make it clear, the journal will not use online submission for the moment. Could I just make a fake submission_file ?
Another question in fact, for some older archive, I do not have the article, only the abstract. In this situation, can I juste omit galley and submission file ?

Regards and thanks again for your quick reply, I do really appreciate your reactivity

Hi @farth,

If you want to have a galley, you’ll need both the article_galley and the submission_file. The article_galley entry refers to the submission_file, which will generally be a PDF or something. (The word “submission” here refers to an article as a whole, not the submission process.)

It is possible to omit the submission file but import a galley, if the galley is available at a remote URL.

Beyond that, submission files are totally optional.

Regards,
Alec Smecher
Public Knowledge Project Team

Ok, thanks for everything !

Regards

Hi @asmecher,

I’ve got one (last I hope) question about the xml format: where do you specify the pages of the article ? Is it an element in the article or an attribute of some other element ? The first give me an error for the moment.

Thanks in advance