Skip to content

Commit

Permalink
Merge pull request #39 from bozana/9959
Browse files Browse the repository at this point in the history
pkp/pkp-lib#9959 use createTextNode for preprint title and subtitle i…
  • Loading branch information
bozana authored May 22, 2024
2 parents d6c7605 + 9ceff74 commit f7767ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions filter/PreprintCrossrefXmlFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function createPostedContentNode($doc, $publication, $submission)

// contributors
$authors = $publication->getData('authors');
if (!empty($authors)) {
if ($authors->count() != 0) {
$contributorsNode = $doc->createElementNS($deployment->getNamespace(), 'contributors');

$isFirst = true;
Expand Down Expand Up @@ -221,17 +221,19 @@ public function createPostedContentNode($doc, $publication, $submission)

// Titles
$titlesNode = $doc->createElementNS($deployment->getNamespace(), 'titles');
$titlesNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'title', $publication->getLocalizedTitle($submission->getData('locale'), 'html')));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'title'));
$node->appendChild($doc->createTextNode($publication->getLocalizedTitle($submission->getData('locale'), 'html')));
if ($subtitle = $publication->getLocalizedSubTitle($submission->getData('locale'), 'html')) {
$titlesNode->appendChild($doc->createElementNS($deployment->getNamespace(), 'subtitle', $subtitle));
$titlesNode->appendChild($node = $doc->createElementNS($deployment->getNamespace(), 'subtitle'));
$node->appendChild($doc->createTextNode($publication->getLocalizedTitle($subtitle, 'html')));
}
$postedContentNode->appendChild($titlesNode);

// Posted date
$postedContentNode->appendChild($this->createPostedDateNode($doc, $publication->getData('datePublished')));

// abstract
$abstracts = $publication->getData('abstract');
$abstracts = $publication->getData('abstract') ?: [];
foreach($abstracts as $lang => $abstract) {
$abstractNode = $doc->createElementNS($deployment->getJATSNamespace(), 'jats:abstract');
$abstractNode->setAttributeNS($deployment->getXMLNamespace(), 'xml:lang', LocaleConversion::getIso1FromLocale($lang));
Expand Down

0 comments on commit f7767ff

Please sign in to comment.