Skip to content

Commit

Permalink
pkp/pkp-lib#8374 Push author biographical statement to JATS
Browse files Browse the repository at this point in the history
  • Loading branch information
ewhanson authored and asmecher committed Nov 22, 2023
1 parent eb6a2d4 commit fb77e91
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions classes/ArticleFront.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,20 @@ public function createArticleContribGroup(Submission $submission, Publication $p
->setAttribute( 'rid', $affiliationToken)->parentNode
->appendChild($this->createTextNode($s));
}

foreach ($author->getData('biography') as $locale => $bio) {
$bioElement = $this->createElement('bio');
$bioElement->setAttribute('xml:lang', substr($locale, 0, 2));

$strippedBio = PKPString::stripUnsafeHtml($bio);
$bioDocument = new \DOMDocument();
$bioDocument->createDocumentFragment();
$bioDocument->loadHTML($strippedBio);
foreach ($bioDocument->getElementsByTagName('body')->item(0)->childNodes->getIterator() as $bioChildNode) {
$bioElement->appendChild($this->importNode($bioChildNode, true));
}
$contribElement->appendChild($bioElement);
}
}
return ['contribGroupElement' => $contribGroupElement, 'affiliations' => $affiliations];
}
Expand Down

0 comments on commit fb77e91

Please sign in to comment.