Describe the issue or problem
I ran into a very specific problem. We have entered all page numbers with “–” instead of “-” which leads to the pages not being included in the XML Metadata for Crossref.
I am contemplating of either changing all “–” to “-” in the database but am asking myself if that is really necessary since the OAI export works just fine.
I am guessing this is handled in ArticleCrossrefXmlFilter.inc.php.
// pages
// CrossRef requires first_page and last_page of any contiguous range, then any other ranges go in other_pages
$pages = $publication->getPageArray();
if (!empty($pages)) {
$firstRange = array_shift($pages);
$firstPage = array_shift($firstRange);
if (count($firstRange)) {
// There is a first page and last page for the first range
$lastPage = array_shift($firstRange);
} else {
// There is not a range in the first segment
$lastPage = '';
}
// CrossRef accepts no punctuation in first_page or last_page
if ((!empty($firstPage) || $firstPage === "0") && !preg_match('/[^[:alnum:]]/', $firstPage) && !preg_match('/[^[:alnum:]]/', $lastPage)) {
$pagesNode = $doc->createElementNS($deployment->getNamespace(), 'pages');
$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'first_page', $firstPage));
if ($lastPage != '') {
$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'last_page', $lastPage));
}
$otherPages = '';
foreach ($pages as $range) {
$otherPages .= ($otherPages ? ',' : '').implode('-', $range);
}
if ($otherPages != '') {
$pagesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'other_pages', $otherPages));
}
$journalArticleNode->appendChild($pagesNode);
}
}
What would your approach be?
Thanks!