Skip to content

Commit

Permalink
Explicitly add xlink namespace prefix
Browse files Browse the repository at this point in the history
The `xlink` namespace prefix is used in the configuration and was
previously assumed to be the prefix for xlink elements. This is not
always true for the input XML files.

Resolves https://jira.slub-dresden.de/browse/CMR-1059
  • Loading branch information
claussni committed Apr 13, 2021
1 parent f24ee9a commit 1926d24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Classes/Helper/XPath.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace EWW\Dpf\Helper;

/*
Expand All @@ -21,6 +22,9 @@ class XPath
* Returns a new XPath object for the given DOMDocument,
* all required namespaces are already registered.
*
* These namespace prefixes are often used in configuration and code, assuming the given namespace.
* Since Kitodo.Publication 4.x namespaces and prefixes are part of the configuration.
*
* @param \DOMDocument $dom
* @return \DOMXPath
*/
Expand All @@ -32,7 +36,7 @@ public static function create($dom)
$xpath->registerNamespace('foaf', "http://xmlns.com/foaf/0.1/");
$xpath->registerNamespace('person', "http://www.w3.org/ns/person#");
$xpath->registerNamespace('rdf', "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
$xpath->registerNamespace('xlink', "http://www.w3.org/1999/xlink");
return $xpath;
}

}

0 comments on commit 1926d24

Please sign in to comment.