Skip to content

Commit

Permalink
Merge pull request #55 from beatrycze-volk/abstractdocument
Browse files Browse the repository at this point in the history
Use getCurrentDocument function
  • Loading branch information
MarcMoschSLUB authored Nov 7, 2023
2 parents f28df58 + 92df8fd commit d511e7e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Classes/ViewHelpers/XpathViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,16 @@ public static function renderStatic(

$document = self::getDocumentRepository()->findOneByParameters($parameters);

if ($document === null || $document->getDoc() === null || !($document->getDoc() instanceof MetsDocument)) {
if ($document === null || $document->getCurrentDocument() === null || !($document->getCurrentDocument() instanceof MetsDocument)) {
return;
}
$currentDocument = $document->getCurrentDocument();
$currentDocument->mets->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
$currentDocument->mets->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
$currentDocument->mets->registerXPathNamespace('dv', 'http://dfg-viewer.de/');
$currentDocument->mets->registerXPathNamespace('slub', 'http://slub-dresden.de/');

$document->getDoc()->mets->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
$document->getDoc()->mets->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
$document->getDoc()->mets->registerXPathNamespace('dv', 'http://dfg-viewer.de/');
$document->getDoc()->mets->registerXPathNamespace('slub', 'http://slub-dresden.de/');

$result = $document->getDoc()->mets->xpath($xpath);
$result = $currentDocument->mets->xpath($xpath);

if (is_array($result)) {
foreach ($result as $row) {
Expand Down

0 comments on commit d511e7e

Please sign in to comment.