Skip to content

Commit 553a9f3

Browse files
committed
Move XPath-constants to xml-common
1 parent 30f5b1c commit 553a9f3

12 files changed

+14
-16
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"ext-spl": "*",
4545

4646
"simplesamlphp/assert": "^1.3",
47-
"simplesamlphp/xml-common": "^1.18"
47+
"simplesamlphp/xml-common": "^1.18.5"
4848
},
4949
"require-dev": {
5050
"simplesamlphp/simplesamlphp-test-framework": "^1.7"

src/Constants.php

-2
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,4 @@ class Constants extends \SimpleSAML\XML\Constants
152152
public const XMLENC_ELEMENT = 'http://www.w3.org/2001/04/xmlenc#Element';
153153
public const XMLENC_ENCRYPTEDKEY = 'http://www.w3.org/2001/04/xmlenc#EncryptedKey';
154154
public const XMLENC_EXI = 'http://www.w3.org/2009/xmlenc11#EXI';
155-
156-
public const XPATH_URI = 'http://www.w3.org/TR/1999/REC-xpath-19991116';
157155
}

src/Utils/XML.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function processTransforms(
101101
}
102102
}
103103
break;
104-
case C::XPATH_URI:
104+
case C::XPATH10_URI:
105105
$xpath = $transform->getXPath();
106106
if ($xpath !== null) {
107107
$arXPath = [];

src/XML/ds/Transform.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ final public function __construct(
3838
if ($xpath !== null) {
3939
Assert::nullOrEq(
4040
$this->algorithm,
41-
C::XPATH_URI,
42-
sprintf('Transform algorithm "%s" required if XPath provided.', C::XPATH_URI),
41+
C::XPATH10_URI,
42+
sprintf('Transform algorithm "%s" required if XPath provided.', C::XPATH10_URI),
4343
);
4444
}
4545

@@ -135,7 +135,7 @@ public function toXML(DOMElement $parent = null): DOMElement
135135
$e->setAttribute('Algorithm', $algorithm);
136136

137137
switch ($algorithm) {
138-
case C::XPATH_URI:
138+
case C::XPATH10_URI:
139139
$this->getXpath()?->toXML($e);
140140
break;
141141
case C::C14N_EXCLUSIVE_WITH_COMMENTS:

tests/XML/ds/RetrievalMethodTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function setUpBeforeClass(): void
5151
public function testMarshalling(): void
5252
{
5353
$transforms = new Transforms(
54-
[new Transform(C::XPATH_URI, new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]))],
54+
[new Transform(C::XPATH10_URI, new XPath('self::xenc:CipherValue[@Id="example1"]', ['xenc' => C::NS_XENC]))],
5555
);
5656

5757
$retrievalMethod = new RetrievalMethod($transforms, '#Encrypted_KEY_ID', C:: XMLENC_ENCRYPTEDKEY);

tests/XML/ds/TransformTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function setUpBeforeClass(): void
5050
public function testMarshalling(): void
5151
{
5252
$transform = new Transform(
53-
C::XPATH_URI,
53+
C::XPATH10_URI,
5454
new XPath('count(//. | //@* | //namespace::*)'),
5555
);
5656

tests/XML/ds/TransformsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testMarshalling(): void
5151
$transforms = new Transforms(
5252
[
5353
new Transform(
54-
C::XPATH_URI,
54+
C::XPATH10_URI,
5555
new XPath(
5656
'count(//. | //@* | //namespace::*)',
5757
),

tests/XML/xenc/CipherReferenceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function setUpBeforeClass(): void
5454
);
5555

5656
$xpath = new XPath('count(//. | //@* | //namespace::*)');
57-
$transform = new Transform(C::XPATH_URI, $xpath);
57+
$transform = new Transform(C::XPATH10_URI, $xpath);
5858
self::$transforms = new Transforms([$transform]);
5959
}
6060

tests/XML/xenc/DataReferenceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testMarshalling(): void
6060
new Transforms(
6161
[
6262
new Transform(
63-
C::XPATH_URI,
63+
C::XPATH10_URI,
6464
new XPath('self::xenc:EncryptedData[@Id="example1"]'),
6565
),
6666
],

tests/XML/xenc/KeyReferenceTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testMarshalling(): void
6060
new Transforms(
6161
[
6262
new Transform(
63-
C::XPATH_URI,
63+
C::XPATH10_URI,
6464
new XPath('self::xenc:EncryptedKey[@Id="example1"]'),
6565
),
6666
],

tests/XML/xenc/ReferenceListTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public static function setUpBeforeClass(): void
5858
public function testMarshalling(): void
5959
{
6060
$transformData = new Transform(
61-
C::XPATH_URI,
61+
C::XPATH10_URI,
6262
new XPath('self::xenc:EncryptedData[@Id="example1"]'),
6363
);
6464
$transformKey = new Transform(
65-
C::XPATH_URI,
65+
C::XPATH10_URI,
6666
new XPath('self::xenc:EncryptedKey[@Id="example1"]'),
6767
);
6868

tests/XML/xenc/TransformsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testMarshalling(): void
5151
$transforms = new Transforms(
5252
[
5353
new Transform(
54-
C::XPATH_URI,
54+
C::XPATH10_URI,
5555
new XPath(
5656
'count(//. | //@* | //namespace::*)',
5757
),

0 commit comments

Comments
 (0)