diff --git a/composer.json b/composer.json index 687c3455..b8a0c81b 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,7 @@ "ext-spl": "*", "simplesamlphp/assert": "^1.3", - "simplesamlphp/xml-common": "^1.18" + "simplesamlphp/xml-common": "^1.18.5" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "^1.7" diff --git a/src/Constants.php b/src/Constants.php index f9e64f35..1a1f2656 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -152,6 +152,4 @@ class Constants extends \SimpleSAML\XML\Constants public const XMLENC_ELEMENT = 'http://www.w3.org/2001/04/xmlenc#Element'; public const XMLENC_ENCRYPTEDKEY = 'http://www.w3.org/2001/04/xmlenc#EncryptedKey'; public const XMLENC_EXI = 'http://www.w3.org/2009/xmlenc11#EXI'; - - public const XPATH_URI = 'http://www.w3.org/TR/1999/REC-xpath-19991116'; } diff --git a/src/Utils/XML.php b/src/Utils/XML.php index b7a3df3c..e17fe16d 100644 --- a/src/Utils/XML.php +++ b/src/Utils/XML.php @@ -101,7 +101,7 @@ public static function processTransforms( } } break; - case C::XPATH_URI: + case C::XPATH10_URI: $xpath = $transform->getXPath(); if ($xpath !== null) { $arXPath = []; diff --git a/src/XML/ds/Transform.php b/src/XML/ds/Transform.php index a1025881..867b4891 100644 --- a/src/XML/ds/Transform.php +++ b/src/XML/ds/Transform.php @@ -38,8 +38,8 @@ final public function __construct( if ($xpath !== null) { Assert::nullOrEq( $this->algorithm, - C::XPATH_URI, - sprintf('Transform algorithm "%s" required if XPath provided.', C::XPATH_URI), + C::XPATH10_URI, + sprintf('Transform algorithm "%s" required if XPath provided.', C::XPATH10_URI), ); } @@ -135,7 +135,7 @@ public function toXML(DOMElement $parent = null): DOMElement $e->setAttribute('Algorithm', $algorithm); switch ($algorithm) { - case C::XPATH_URI: + case C::XPATH10_URI: $this->getXpath()?->toXML($e); break; case C::C14N_EXCLUSIVE_WITH_COMMENTS: diff --git a/tests/XML/ds/RetrievalMethodTest.php b/tests/XML/ds/RetrievalMethodTest.php index 45e25b8f..adc56217 100644 --- a/tests/XML/ds/RetrievalMethodTest.php +++ b/tests/XML/ds/RetrievalMethodTest.php @@ -51,7 +51,7 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $transforms = new Transforms( - [new Transform(C::XPATH_URI, new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]))], + [new Transform(C::XPATH10_URI, new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]))], ); $retrievalMethod = new RetrievalMethod($transforms, '#Encrypted_KEY_ID', C:: XMLENC_ENCRYPTEDKEY); diff --git a/tests/XML/ds/TransformTest.php b/tests/XML/ds/TransformTest.php index 13e37cbe..b7038eba 100644 --- a/tests/XML/ds/TransformTest.php +++ b/tests/XML/ds/TransformTest.php @@ -50,7 +50,7 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $transform = new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath('count(//. | //@* | //namespace::*)'), ); diff --git a/tests/XML/ds/TransformsTest.php b/tests/XML/ds/TransformsTest.php index 633f0aaa..8c8109b6 100644 --- a/tests/XML/ds/TransformsTest.php +++ b/tests/XML/ds/TransformsTest.php @@ -51,7 +51,7 @@ public function testMarshalling(): void $transforms = new Transforms( [ new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath( 'count(//. | //@* | //namespace::*)', ), diff --git a/tests/XML/xenc/CipherReferenceTest.php b/tests/XML/xenc/CipherReferenceTest.php index 87f99636..ef68a877 100644 --- a/tests/XML/xenc/CipherReferenceTest.php +++ b/tests/XML/xenc/CipherReferenceTest.php @@ -54,7 +54,7 @@ public static function setUpBeforeClass(): void ); $xpath = new XPath('count(//. | //@* | //namespace::*)'); - $transform = new Transform(C::XPATH_URI, $xpath); + $transform = new Transform(C::XPATH10_URI, $xpath); self::$transforms = new Transforms([$transform]); } diff --git a/tests/XML/xenc/DataReferenceTest.php b/tests/XML/xenc/DataReferenceTest.php index 26bfad96..48028e67 100644 --- a/tests/XML/xenc/DataReferenceTest.php +++ b/tests/XML/xenc/DataReferenceTest.php @@ -60,7 +60,7 @@ public function testMarshalling(): void new Transforms( [ new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath('self::xenc:EncryptedData[@Id="example1"]'), ), ], diff --git a/tests/XML/xenc/KeyReferenceTest.php b/tests/XML/xenc/KeyReferenceTest.php index 310fe42c..092b8800 100644 --- a/tests/XML/xenc/KeyReferenceTest.php +++ b/tests/XML/xenc/KeyReferenceTest.php @@ -60,7 +60,7 @@ public function testMarshalling(): void new Transforms( [ new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath('self::xenc:EncryptedKey[@Id="example1"]'), ), ], diff --git a/tests/XML/xenc/ReferenceListTest.php b/tests/XML/xenc/ReferenceListTest.php index e3fa10e9..19aa5601 100644 --- a/tests/XML/xenc/ReferenceListTest.php +++ b/tests/XML/xenc/ReferenceListTest.php @@ -58,11 +58,11 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $transformData = new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath('self::xenc:EncryptedData[@Id="example1"]'), ); $transformKey = new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath('self::xenc:EncryptedKey[@Id="example1"]'), ); diff --git a/tests/XML/xenc/TransformsTest.php b/tests/XML/xenc/TransformsTest.php index 5aa93f7d..9aa0261d 100644 --- a/tests/XML/xenc/TransformsTest.php +++ b/tests/XML/xenc/TransformsTest.php @@ -51,7 +51,7 @@ public function testMarshalling(): void $transforms = new Transforms( [ new Transform( - C::XPATH_URI, + C::XPATH10_URI, new XPath( 'count(//. | //@* | //namespace::*)', ),