File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 77use DOMElement ;
88use SimpleSAML \XML \Assert \Assert ;
99use SimpleSAML \XML \Exception \{InvalidDOMElementException , InvalidValueTypeException };
10- use SimpleSAML \XML \Type \{ValueTypeInterface , StringValue };
10+ use SimpleSAML \XML \Type \{QNameValue , StringValue , ValueTypeInterface };
1111
1212use function defined ;
1313use function strval ;
@@ -40,9 +40,14 @@ public static function fromXML(DOMElement $xml): static
4040 Assert::same ($ xml ->namespaceURI , static ::NS , InvalidDOMElementException::class);
4141
4242 $ type = self ::getTextContentType ();
43- $ text = $ type ::fromString ($ xml ->textContent );
43+ if ($ type === QNameValue::class) {
44+ $ qName = QNameValue::fromDocument ($ xml ->textContent , $ xml );
45+ $ text = $ qName ->getRawValue ();
46+ } else {
47+ $ text = $ xml ->textContent ;
48+ }
4449
45- return new static ($ text );
50+ return new static ($ type :: fromString ( $ text) );
4651 }
4752
4853
You can’t perform that action at this time.
0 commit comments