ajnyga / embedGalley

OJS3 plugin for visualizing JATS XML galleys
GNU General Public License v3.0
8 stars 3 forks source link

DOMDocument loads asks for dtd file #3

Closed GrazingScientist closed 6 years ago

GrazingScientist commented 6 years ago

Another error: The DOMDocument::load() asks for a .dtd file. As far as I understand, this is required for translating the article tags to HTML. If I provide a dtd file, it is never sufficient (because some tags are not found, etc.). Could you provide an example of your JATS input files that work?

Edit: Sorry! Its not the DODocument but the XSLTProcessor::transformToDoc() asking for the dtd

GrazingScientist commented 6 years ago

The exact error is: [Tue Sep 25 15:23:20.695790 2018] [:error] [pid 7232] PHP Warning: XSLTProcessor::transformToDoc(): Validation failed: no DTD found !runtime error: file testling/plugins/generic/embedGalley/xsl/jats-to-html.xsl line 1004 element copy-of in /testling/plugins/generic/embedGalley/EmbedGalleyPlugin.inc.php on line 260, referer: https://ojs.ub.uni-frankfurt.de/testling/index.php/ltz/index

ajnyga commented 6 years ago

Before I debug anything can you check if the original code with this line in place https://github.com/ajnyga/embedGalley/blob/master/EmbedGalleyPlugin.inc.php#L247 works if you remove your htaccess for a while?

GrazingScientist commented 6 years ago

So, I went back to your original code, deactivated the .htaccess but still the dtd file is demanded :(

ajnyga commented 6 years ago

Can you send me the XML file that causes that error? ajnyga@gmail.com This way we can rule out the problem with the file itself.

GrazingScientist commented 6 years ago

I tried a file provided by asmecher: https://github.com/asmecher/texture/blob/master/texture/data/kitchen-sink/manuscript.xml I tried it both with and without the 2. line of the file.

Interestingly, the lensGalley can render the file.... :(

Hope, you can help!

ajnyga commented 6 years ago

This validator seems to give a lot of errors for that document: http://jats4r.org/validator/

For example: "Bad doctype declaration. Unrecognized public identifier: 'TextureArticle 0.1.0' No reference to any JATS schema (doctype declaration, xml-model processing instruction, or xsd attributes on the root node) were found. We recommend that all JATS documents identify which version of JATS the comply with, by using one of these mechanisms."

ajnyga commented 6 years ago

I think I have used these examples my self: https://jats.nlm.nih.gov/publishing/tag-library/1.1d1/n-cq42.html

ajnyga commented 6 years ago

But I will test the plugin tomorrow with 3.1.1.2 and different test files and see what happens.

GrazingScientist commented 6 years ago

Thanks! I will do further testing too. :)

GrazingScientist commented 6 years ago

Mh! Probably it is really some kind of broken XML. I tried some pandoc generated JATS and it works just fine. :/

ajnyga commented 6 years ago

Yeah, it probably just can not load the http://substance.io/TextureArticle-1.0.0.dtd because it does not exist, so the validation fails.