[OJS] - Problems with Native XML Importer

Hey all!
I created this XML-file to import articles into one of my journals issues. These are all “back issues” that is going to be imported through the native xml importer.

Here is my problem. the linked XML above works fine, and I’ve used that as model to import a few issues with articles into the journal. But after a while, the linked papers start to be incorrectly linked when imported to OJS, images go missing, links to actual papers are incorrect and thus no one can open and read the article.

For example, my issue 5-1 is partially imported and links are all wrong all of a sudden. (see image)

Here’s the link to my XML-file for issue 5-1: XML-File

To make things even more complex, some of the imports fail with messages about open endings, and extra things at end of file. Even though I used same model that is working perfect for 1-1.

Is there a better way to import articles and issues to a journal? Any support for JSON, API?
Do we have any other alternatives? All my material is static, and is to be imported from my Bitbucket repo.

Upon importing issue 2-4 (using this file), I get these validation errors upon clicking ‘Import’.

Please help! :slight_smile:

The XML import is the best method currently, but XML is very exacting.

For 2-4, you have closed an article tag early on line 109, I think.

103       <article_galley xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" approved="true" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
104         <id type="internal" advice="ignore">62</id>
105         <name locale="en_US">model2.gif</name>
106         <seq>1</seq>
107         <submission_file_ref id="69" revision="1"/>
108       </article_galley>
109     </article>
111     <article_galley xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" approved="true" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
112         <id type="internal" advice="ignore">63</id>
113         <name locale="en_US"></name>
114         <seq>2</seq>
115         <submission_file_ref id="70" revision="1"/>
116       </article_galley>
117     </article>
1 Like

For 5-1, your submission file ids don’t seem to correspond to your galleys. For example, I would expect the referenced submission file on line 132 to be “204”, to match the id you gave this article’s submission file on line 120.

120       <submission_file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" stage="submission" id="204" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
121       <revision number="1" genre="Article Text" filename="paper65.html" viewable="false" date_uploaded="1999-10-01" date_modified="2019-08-27" filetype="text/html" uploader="christe    rjohansson">
122           <name locale="en_US">Information science in sustainable development and de-industrialization</name>
123           <href src="https://bitbucket.org/christerjohansson/information-research/raw/master/2017-2019/issues/5-1/paper65.html"></href>
124         </revision>
125       </submission_file>
127       <!--GALLEYS-->
128       <article_galley xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" approved="true" xsi:schemaLocation="http://pkp.sfu.ca native.xsd">
129         <id type="internal" advice="ignore">197</id>
130         <name locale="en_US">Information science in sustainable development and de-industrialization</name>
131         <seq>2</seq>
132         <submission_file_ref id="205" revision="1"/>
133       </article_galley>
134     </article>
1 Like

That is a very good reason indeed!
Thank you very much! :slight_smile:

How did you find this? Is there a way to validate the XML beforehand against the set template?
I have a couple more similar XML’s that don’t import properly. I’ve had others doing some of these XML’s and I have yet to confirm a lot of it.

I used the xmllint command from a linux shell.

There are also tools online for well-formed XML, or for actual schema checks.

1 Like