diff --git a/src/XPath/XPath.php b/src/XPath/XPath.php index d1b4575f..0f22ad55 100644 --- a/src/XPath/XPath.php +++ b/src/XPath/XPath.php @@ -124,13 +124,11 @@ private static function registerAncestorNamespaces(DOMXPath $xp, DOMNode $node): if ($attr->namespaceURI !== C_XML::NS_XMLNS) { continue; } - $prefix = $attr->localName; + $prefix = $attr->prefix; $uri = (string) $attr->nodeValue; if ( - $prefix === null || $prefix === '' || - $prefix === 'xmlns' || $uri === '' || - isset($prefixToUri[$prefix]) + $prefix === '' || $prefix === 'xmlns' || $uri === '' || isset($prefixToUri[$prefix]) ) { continue; }