OJS 3 - CrossRef Xml Validation Error with xmlns:jats

Hello

I am using OJS3 and I was trying validate XML DOI to deposit on CrossRef.

With this tool:
https://data.crossref.org/reports/parser.html

When I upload my XML I got this error:

[Error] crossref4.3.6.xsd:2:35: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'. [Error] crossref4.3.6.xsd:4:34: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw '301 Moved Permanently'. [Error] crossref4.3.6.xsd:5:33: s4s-elt-character: Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs:documentation'. Saw 'nginx/1.9.3 (Ubuntu)'. [Fatal Error] crossref4.3.6.xsd:6:3: The element type "hr" must be terminated by the matching end-tag "". error: A Parse error occurred - The element type "hr" must be terminated by the matching end-tag "".

And playing around with XML I’ve figured out that if I remove xmlns:jats and xmlns:ai from < doi_batch > tag all XML validates.

Example:

Changing this:

<doi_batch version="4.3.6" xmlns="http://www.crossref.org/schema/4.3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.3.6 http://www.crossref.org/schema/deposit/crossref4.3.6.xsd" xmlns:jats="http://www.ncbi.nlm.nih.gov/JATS1" xmlns:ai="http://www.crossref.org/AccessIndicators.xsd"> 

To this:

<doi_batch version="4.3.6" xmlns="http://www.crossref.org/schema/4.3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.crossref.org/schema/4.3.6 http://www.crossref.org/schema/deposit/crossref4.3.6.xsd"> 

All XML validates. Anyone has faced some similar issue before?

Best

Israel

Hi @israel.cefrin

I think that Crossref changed some URLs and apparently those for JATS and AI as well. I’ll take a look i.e. ask them to provide a redirect from old to new URLs, so that XMLs are valid again…

Edit: it was the case also for the main Crossref schema, s. OJS3.0.2 and Crossref Plugin validation error - #10 by bozana and for that they already implemented the redirect…

Thanks!
Bozana

1 Like

Hi @bozana

I’ve read the previous thread you sent. And I was wondering exactly what you said: redirection.

In deed, the URL schema http://www.crossref.org/schema/4.3.6 also has a redirection problem, it is returning 404 error. So, if U could ask them to verify it too would be great.

Tks in advance

Best
Israel

Hi @israel.cefrin

Could you maybe send me the XML document that didn’t validate?
Edit: my example with JATS and AI, with the old URLs, works…

Thanks a lot!
Bozana

Hi @bozana

I’ve generate XML once more and now it validates.
I’m asking to my editor DOI manager to deposit XML on CrossRef and check if it is working too.

I will keep in touch as soon he tests/deposits it.

Best
Israel

@bozana

We tryed deposit, but we’ve got this error:

<?xml version="1.0" encoding="UTF-8"?>
<doi_batch_diagnostic status="completed" sp="ds3.crossref.org">
   <submission_id>1402025841</submission_id>
   <batch_id>_1486648090</batch_id>
   <record_diagnostic status="Failure" msg_id="29">
      <doi />
      <msg>Deposited XML is not well-formed or does not validate: Error on line 1: Content is not allowed in prolog.: Error on line 1: Content is not allowed in prolog.</msg>
   </record_diagnostic>
   <batch_data>
      <record_count>1</record_count>
      <success_count>0</success_count>
      <warning_count>0</warning_count>
      <failure_count>1</failure_count>
   </batch_data>
</doi_batch_diagnostic>

The XML is pasted here: http://pastebin.com/ePTTEuee

I’ve noticed that when editors are exporting XML, the header response is this:

Erros de validação:

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

unterminated entity reference Tecnologia

Failed to locate the main schema resource at 'http://www.crossref.org/schema/deposit/crossref4.3.6.xsd'.

And below is appears all XML response (they copy an paste on a file and save as XML).

Is it correct?

Best
Israel

Hi @israel.cefrin

Hmmm… it is a little bit strange :-
Do you use the current OJS 3.0.2 version? I strongly recommend that, because it contains lots of fixes!

When you export Crossref XML in OJS, the XML will be validated by PHP function. If there is validation problem it will be displayed to the user, together with the XML. This XML shouldn’t be used, because it is not valid – it is displayed just for the user to figure out what/where is the problem.
If there is no validation problem, the XML will be provided for download. Eventually, in the older OJS versions the XML could be just displayed in the Browser. In that case it would be correct to first view the page source code and then copy the XML from there. But, this also changed in the new OJS version – the XML will now be provided for download as a file.

If I understand you correctly, some validation errors (those “unterminated entity…”) do occur in OJS, right? – Those also seem to me to be from the older OJS version, where HTML entities were not escaped correctly…

The message “Failed to locate the main schema resource at ‘http://www.crossref.org/schema/deposit/crossref4.3.6.xsd’.” shouldn’t actually appear any more (since today) in OJS, because the Crossref provided the redirection for that old URL – the new URL is http://data.crossref.org/schemas/crossref4.3.6.xsd – and the PHP validator should be OK with that redirection.

But actually, the XML that you provided is valid if you test it here: crossref.org : metadata quality check. Did you try to deposit exactly that XML? – the deposit message looks a little bit strange, like the XML was not clean…

So I would recommend to use the newest OJS version, to try to export XML and see if there is any validation error message displayed in OJS, and also to double check what XML is then deposited.

Thanks!
Bozana

No, I’ve check it out and it is running 3.0.1.0, I will update asap.

I will do that. But now I understood what was wrong. The editor copy / paste the XML from browser on a text editor and saved it with BOM. This affects file validation.

I “rebyte” without BOM the file and deposit is ok.

Thank you very much @bozana , your help and explanaition teach me much more about OJS and its features.

Best

Israel