Native export failure in OJS 3.0.1.0

I tried to export issue in OJS 3.0.1.0 but I got the following error message:
Warning: DOMDocument::schemaValidate(): Internal error: xmlSchemaVDocWalk, there is at least one entity reference in the node-tree currently being validated. Processing of entities with this XML Schema processor is not supported (yet). Please substitute entities before validation… in /home/smeitss/public_html/bibliografija/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 126

Warning: DOMDocument::schemaValidate(): Element ‘{http://pkp.sfu.ca}issue’: Missing child element(s). Expected is ( {http://pkp.sfu.ca}articles ). in /home/smeitss/public_html/bibliografija/lib/pkp/classes/xslt/XMLTypeDescription.inc.php on line 126
Could not convert issues.

Please advise

Hi @vvucic,

Hmm, I’ve never seen that error before – I’d suggest dumping the XML to the browser to see what it looks like. Edit lib/pkp/classes/xslt/XMLTypeDescription.inc.php and find the problematic line of code:

if (!$xmlDom->schemaValidate($this->_validationSource)) return false;

Right before that, add…

print_r($xmlDom->saveXML());

This will dump the XML to the browser. From there you an save it to a local XML file, and then e.g. try validating it locally.

Regards,
Alec Smecher
Public Knowledge Project Team

When I do that when trying to export issue I get on screen in my browser a lot of dump like in screenshot in attach.

When I try to export one article I have got the following as in screenshot

As far as I see it exports whole pdf files. Is that right?

Thanks

Hi @vvucic

Yes, the whole pdf files are exported, base64 encoded. But this is not the problem. It seems like something is wrong with the XML, the XML is not valid, for a reason. The screenshots do not show the XML unfortunately. Is there a way you could get the XML? Maybe if you say “View Page Source”? And could you maybe post me/us the XML, especially the beginning of the XML?

I can try to change the code for this plugin so that the invalid XML is always visible in the browser…

Thanks!
Bozana

Hello, This is output from page source:

<?xml version="1.0"?>
<articles xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca native.xsd"/>
<?xml version="1.0"?>
<articles xmlns="http://pkp.sfu.ca" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pkp.sfu.ca native.xsd"/>

Hmmm… I do not see anything… :slight_smile:

Yes, maybe that is the problem that it actually does not produce real xml?

Hmmm… But what are the screenshots above – they contain more data than just a line?

Screenshots above soooo big> I just showed small part. Actually, there is textual output what is written between supposed XML tags. But, there are no XML tags. The rest is pdf file(s).
Any suggestion?

Hi @vvucic

Could you maybe apply these changes: pkp/pkp-lib#2117 display native export validation errors · pkp/ojs@8f27208 · GitHub

These are minimal changes needed to display export validation error messages and XML in the browser. XML will be displayed in one line i.e. not formatted nicely, but I think it is OK for now, else you would need to apply a few other changes as well.
Remove the earlier change from here. And let us know how the XML looks like… :slight_smile:

Thanks!
Bozana

After changes I entered when go to Tools/Export/import I do not see the list of tools anymore.
I returend back the file without changes and tools appeared.

Any advise?

Hmmm… Could you send me your file NativeImportExportPlugin.inc.php ?
The changes actually shouldn’t break anything… Are you sure you entered them correctly?
If you send me your file I can check it…

I entered changes again and I have see the same as before. I tried to export one article in native XML.On the top of output I see pure text and coding for pdf file below. See attach. screenshot.
What I can do more?

Have you removed the change from Alec above ( print_r($xmlDom->saveXML()); )?

After I removed changes about printing I tried to export one article and downloaded xml file

When I tried to export issue I have got the following message:
Validation errors:unterminated entity reference Chemical Engineering Niigata Universityunterminated entity reference Chemical Engineering Niigata Universityunterminated entity reference Chemical Engineering Niigata UniversityInternal
error: xmlSchemaVDocWalk, there is at least one entity reference in the
node-tree currently being validated. Processing of entities with this
XML Schema processor is not supported (yet). Please substitute entities
before validation…Element ‘{http://pkp.sfu.ca}issue’: Missing child element(s). Expected is ( {http://pkp.sfu.ca}articles ).Invalid XML:<?xml version="1.0"?>
4<issue_identification>712003Thermal Science</issue_identification><date_published>2016-10-24</date_published><last_modified>2016-10-24</last_modified>1ARTArticles<issue_galleys xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://pkp.sfu.ca native.xsd”/>
Could not convert selected objects.

Hmmm… Crazy… that there are no XML elements… :open_mouth:
I do not understand it…

So, export of article works fine. But, export of issue does have problems.
I do not know what can be issue :confused:
Thanks

What is this “Chemical Engineering Niigata University” ? How many articles does that issue have?
Is there maybe a galley (e.g. PDF for the whole issue) for that issue or a cover image?
Can you export the article containing the text from the screenshots above “DejanP.NINKOVIc…” ?

That issue does have 6 articles and it is published here:
http://thermal-science.tech/index.php/thsci/issue/view/4
That university is mentioned here:
http://thermal-science.tech/index.php/thsci/article/view/36

Let me know if I can help more.

Thanks

Hmmm… Maybe because those affiliations contain “&”. We recently solved the encoding problem, s. DOMDocument::createElementNS() is being used without consideration for escaping · Issue #2074 · pkp/pkp-lib · GitHub. Did you manage to export that article http://thermal-science.tech/index.php/thsci/article/view/36 ?