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 377 times
non_numeric.png
non_numeric.png (4.05 KiB) Viewed 377 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: 10015
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: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error with CrossRef XML Export Plugin

Postby bdgregg » Tue Feb 10, 2015 11:48 am

All,

We just ran accross the exact same issue here with one of our journals who wishes to use roman numerals in their page numbering.

According to the CrossRef XML Specification here: (http://www.crossref.org/help/schema_doc/4.3.5/4_3_5.html#pages) it states:

The container for information about page ranges. When an entity has non-contiguous page information, you should capture the first page range in first_page and last_page. Any additional page information should be captured in other_pages. Punctuation is only allowed in other_pages. It should not appear in first_page and last_page. Page number letter prefixes or suffixes should be included. Roman numeral pages are permitted in both upper case and lower case. Data may be alpha, numeric or a combination.


So yes Roman numerals should be allowed. Can Obi's change be incorporated as is or is there more checking that should be done?

This may come in handy for testing a regular express against roman numerals: http://stackoverflow.com/questions/267399/how-do-you-match-only-valid-roman-numerals-with-a-regular-expression but might have to alter the regex to include lower case as well.

Thanks,
Brian Gregg
University of Pittsburgh.
bdgregg
 
Posts: 118
Joined: Wed Sep 15, 2004 8:21 am
Location: University of Pittsburgh

Re: Error with CrossRef XML Export Plugin

Postby asmecher » Tue Feb 10, 2015 12:17 pm

Hi Brian,

I think a better implementation would be to test for a specific format, rather than treating word boundaries as though they'll behave predictably. For example, pages will probably be like...

pp. 1-15
p1-15
p1-p15
iii-iv
pp. 1 - 15
...etc.

I suspect you'll probably have a fairly exemplary corpus over there to look over. The trouble with relaxing the current approach to permit non-numeric characters is that at times it'll likely match the "pp." part.

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

Re: Error with CrossRef XML Export Plugin

Postby ctgraham » Tue Feb 10, 2015 2:01 pm

I think we're also in violation of the schema by pushing everything in the remainder of the page information into the other_pages element, regardless of whether there is a contiguous range or not.
ctgraham
 
Posts: 240
Joined: Thu Apr 03, 2014 5:29 am
Location: Pitt ULS

Re: Error with CrossRef XML Export Plugin

Postby asmecher » Tue Feb 10, 2015 2:50 pm

Hi all,

This is filed in github at the following URL:
https://github.com/pkp/pkp-lib/issues/333

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


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests