File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77use Dom ;
88use SimpleSAML \XML \Assert \Assert ;
9+ use SimpleSAML \XML \Constants as C ;
910use SimpleSAML \XMLSchema \Type \Interface \ValueTypeInterface ;
1011use SimpleSAML \XMLSchema \Type \StringValue ;
1112
@@ -99,7 +100,7 @@ public function toXML(Dom\Element $parent): Dom\Element
99100 {
100101 if ($ this ->getNamespaceURI () !== null && !$ parent ->lookupPrefix ($ this ->getNamespacePrefix ())) {
101102 $ parent ->setAttributeNS (
102- ' http://www.w3.org/2000/xmlns/ ' ,
103+ C:: NS_XMLNS ,
103104 'xmlns: ' . $ this ->getNamespacePrefix (),
104105 $ this ->getNamespaceURI (),
105106 );
Original file line number Diff line number Diff line change 66
77use Dom ;
88use SimpleSAML \XML \Assert \Assert ;
9+ use SimpleSAML \XML \Constants as C ;
910use SimpleSAML \XMLSchema \Exception \InvalidDOMElementException ;
1011use SimpleSAML \XMLSchema \Exception \InvalidValueTypeException ;
1112use SimpleSAML \XMLSchema \Type \Interface \ValueTypeInterface ;
@@ -101,7 +102,7 @@ public function toXML(?Dom\Element $parent = null): Dom\Element
101102 if ($ this ->getTextContentType () === QNameValue::class) {
102103 if (!$ e ->lookupPrefix ($ this ->getContent ()->getNamespaceURI ()->getValue ())) {
103104 $ e ->setAttributeNS (
104- ' http://www.w3.org/2000/xmlns/ ' ,
105+ C:: NS_XMLNS ,
105106 'xmlns: ' . $ this ->getContent ()->getNamespacePrefix ()->getValue (),
106107 $ this ->getContent ()->getNamespaceURI ()->getValue (),
107108 );
Original file line number Diff line number Diff line change 99use PHPUnit \Framework \Attributes \CoversClass ;
1010use PHPUnit \Framework \Attributes \DataProvider ;
1111use PHPUnit \Framework \TestCase ;
12+ use SimpleSAML \XML \Constants as C ;
1213use SimpleSAML \XML \DOMDocumentFactory ;
1314use SimpleSAML \XPath \XPath ;
1415
@@ -265,7 +266,7 @@ public function testXmlnsPrefixedDeclarationRegistersNamespaceViaAttributeBranch
265266 $ doc ->appendChild ($ root );
266267
267268 // Add xmlns:foo on the root (attribute-branch should detect and register)
268- $ root ->setAttributeNS (' http://www.w3.org/2000/xmlns/ ' , 'xmlns:foo ' , 'https://example.org/foo ' );
269+ $ root ->setAttributeNS (C:: NS_XMLNS , 'xmlns:foo ' , 'https://example.org/foo ' );
269270
270271 // Deep subtree that uses foo prefix but the context node itself is unprefixed
271272 $ ctx = $ doc ->createElement ('ctx ' );
You can’t perform that action at this time.
0 commit comments