Skip to content

Commit 6dfbb03

Browse files
committed
Always use element namespace as target namespace
1 parent 7243e65 commit 6dfbb03

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Metadata/Converter/Types/Configurator/XmlTypeInfoConfigurator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public function __invoke(EngineType $engineType, mixed $xsdType, TypesConverterC
2727
$itemName = $item?->getName() ?: $type?->getName();
2828
$typeName = $type?->getName() ?? '';
2929
$targetNamespace = $xsdType->getSchema()->getTargetNamespace() ?? '';
30-
$typeNamespace = $type?->getSchema()->getTargetNamespace() ?: $targetNamespace;
30+
$typeNamespace = match (true) {
31+
$item instanceof ElementItem => $targetNamespace,
32+
$type !== null => $type?->getSchema()->getTargetNamespace(),
33+
default => $targetNamespace
34+
};
3135

3236
$parentContext = $context->parent()->unwrapOr(null);
3337
$xmlTypeName = match(true) {

0 commit comments

Comments
 (0)