Skip to content

Commit 2396954

Browse files
committed
Fix for QName attributes
1 parent efc32a2 commit 2396954

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AbstractElement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use SimpleSAML\XML\Assert\Assert;
1010
use SimpleSAML\XML\Exception\{MissingAttributeException, SchemaViolationException};
1111
use SimpleSAML\XML\SerializableElementTrait;
12-
use SimpleSAML\XML\Type\{StringValue, ValueTypeInterface};
12+
use SimpleSAML\XML\Type\{QNameValue, StringValue, ValueTypeInterface};
1313

1414
use function array_slice;
1515
use function defined;
@@ -79,7 +79,7 @@ public static function getAttribute(
7979
);
8080

8181
$value = $xml->getAttribute($name);
82-
return $type::fromString($value);
82+
return ($type === QNameValue::class) ? QNameValue::fromDocument($value, $xml) : $type::fromString($value);
8383
}
8484

8585

0 commit comments

Comments
 (0)