OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Error with CrossRef XML Export Plugin

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Error with CrossRef XML Export Plugin

Postby obi » Tue Jul 15, 2014 4:54 am

Hi,
When generating an xml file, if an article has a non-numeric "pages" value (ex. III-IV), only <pages/> is generated. But it is ok if the article has a numeric value (ex. 103-120). See attachment files. Any patch to this problem?
We are running OJS 2.4.4.1.

Thanks
-Obi
Attachments
numeric.png
numeric.png (8.6 KiB) Viewed 193 times
non_numeric.png
non_numeric.png (4.05 KiB) Viewed 193 times
obi
 
Posts: 52
Joined: Wed Jun 09, 2004 5:56 am

Re: Error with CrossRef XML Export Plugin

Postby asmecher » Tue Jul 15, 2014 10:32 am

Hi Obi,

Can you describe your requirements e.g. for roman numerals? If it's a convention, perhaps it might be good idea to add support for parsing.

The current implementation is in plugins/importexport/crossref/CrossRefExportDom.inc.php in the "generateJournalArticleDom" function. Look for the conditional starting with...
Code: Select all
if ($article->getPages() != '') {
Your two options are...
  • Cause the export DOM to not include the <pages> element if the numbers couldn't be parsed, or
  • Add support for Roman numeral parsing
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8844
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error with CrossRef XML Export Plugin

Postby obi » Wed Jul 16, 2014 5:23 am

Hi Alec,
What i did:
I simply replaced (non-digits match),
Code: Select all
if (preg_match('/^[^\d]*(\d+)\D*(.*)$/', $article->getPages(), $matches)) {

with (non-word characters match)
Code: Select all
if (preg_match('/^[^\w]*(\w+)\W*(.*)$/', $article->getPages(), $matches)) {

and it works.

Obi
obi
 
Posts: 52
Joined: Wed Jun 09, 2004 5:56 am

Re: Error with CrossRef XML Export Plugin

Postby asmecher » Wed Jul 16, 2014 8:02 am

Hi Obi,

OK -- but are you sure that CrossRef will accept non-numeric page numbers like this?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8844
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests