Skip to content

Commit d6fccd1

Browse files
committed
Fix normalization for null-prefix
1 parent 4bf0ac7 commit d6fccd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/XMLSchema/Type/QNameValue.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ public static function fromDocument(
176176
}
177177

178178
// Will return the default namespace (if any) when prefix is NULL
179-
$namespaceURI = DOMDocumentFactory::lookupNamespaceUri($element, $namespacePrefix);
179+
if ($namespacePrefix === null) {
180+
$namespaceURI = $element->lookupNamespaceURI($namespacePrefix);
181+
} else {
182+
$namespaceURI = DOMDocumentFactory::lookupNamespaceUri($element, $namespacePrefix);
183+
}
180184

181185
return new static('{' . $namespaceURI . '}' . ($namespacePrefix ? $namespacePrefix . ':' : '') . $localName);
182186
}

0 commit comments

Comments
 (0)