How to import local galley file during Native XML plugin import

I am using OJS 3.3.0.12. We have many HTML back issues to import. I tested out my XML import file for the Native XML plugin using 2 articles. It validates against the native.xsd schema. Almost everything went smoothly - all of the metadata went through and it created a new issue based on the issue identification data.

The only problem is I’m not sure where to put the local path for the article file to be uploaded. I don’t need to upload any submission files, only the final HTML galley to be published. The schema has changed over the years. I see references to but that is not supported under the <article_galley> tag. The sample article XML files in the documentation are 404 pages and I’m having a hard time finding a model for the 3.3 version. I can put in but when I do, OJS expects the file to be available remotely at another URL and tries to link to it but does not actually import it. I want to be able to import the file from a local path on the same server.

So my question is: where in the XML import file should the local file paths to article galleys go? I was planning to use an absolute file path for HTML files stored on the same server.

Here is a screenshot of my a sample of my XML import file which shows how I tried using the tag. I also share a sample of another failed attempt below using the <submission_file> tag.

Thanks!
Joanna

Just want to clarify - the first screenshot I show is an example of an import file that went through smoothly except the galley file did not come through as seems to be intended to communicate a link to an externally hosted file.
The second screenshot failed to import.

Hi @Joanna_Lee

I think the remote element can’t be used to import a galley. You need to embed the galley using the embed element and to base64 encode the content of the galley.

To get an example XML and to inspect the format, you need to do the reverse: Create an example submission and upload a galley. After that export the submission as Native XML.

Thank you for the reply! I did look at the exported XML when I started but I was hoping to avoid embedding the galley, which is how the files are represented in the export. I am writing an XSLT script to convert from an XML export of spreadsheet data to the XML import file. I was hoping there was a way to use the local file path because that makes for a simpler workflow. And while I don’t know much about character encoding, I know in the past I’ve had trouble preserving it during multiple exports and transformations. If I don’t figure out a way to import HTML files using a local file path, I may just use the native import to get all the metadata in and then manually add the galleys through the dashboard. Thanks for the help!

If you work just with XSLT, you can find a pure XSLT implementation of base64 encoding at GitHub - ilyakharlamov/xslt_base64: Base64 decoding and encoding using pure XSLT 1.0

If you work with a mixture of PHP and XSLT, you can encode with base64_encode(file_get_contents($yourfilepath)) and pass the result to the XSLTProcessor.

Thank you for the help! I really appreciate it.
Joanna

Hi!
Local galley could be uploaded via native xml import tool specified in element ‘submission_file’. It’s filepath must be defined from root of server, not from root of site. Example of xml, successfully uploaded to ojs 3.3.0-12, 3.4.0-3 is this.