diff --git a/src/Constants.php b/src/Constants.php index 99c99b2..9979c8b 100644 --- a/src/Constants.php +++ b/src/Constants.php @@ -27,32 +27,7 @@ class Constants public const NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance'; /** - * The namespace-attribute values for xs:any elements + * The maximum amount of child nodes this library is willing to handle. */ - public const XS_ANY_NS_ANY = '##any'; - public const XS_ANY_NS_LOCAL = '##local'; - public const XS_ANY_NS_OTHER = '##other'; - public const XS_ANY_NS_TARGET = '##targetNamespace'; - - public const XS_ANY_NS = [ - self::XS_ANY_NS_ANY, - self::XS_ANY_NS_LOCAL, - self::XS_ANY_NS_OTHER, - self::XS_ANY_NS_TARGET, - ]; - - /** - * The processContents-attribute values for xs:any elements - */ - public const XS_ANY_PROCESS_LAX = 'lax'; - public const XS_ANY_PROCESS_SKIP = 'skip'; - public const XS_ANY_PROCESS_STRICT = 'strict'; - - public const XS_ANY_PROCESS = [ - self::XS_ANY_PROCESS_LAX, - self::XS_ANY_PROCESS_SKIP, - self::XS_ANY_PROCESS_STRICT, - ]; - public const UNBOUNDED_LIMIT = 10000; } diff --git a/src/ExtendableAttributesTrait.php b/src/ExtendableAttributesTrait.php index 98e8695..af5090a 100644 --- a/src/ExtendableAttributesTrait.php +++ b/src/ExtendableAttributesTrait.php @@ -9,6 +9,7 @@ use SimpleSAML\Assert\Assert; use SimpleSAML\XML\Attribute; use SimpleSAML\XML\Constants as C; +use SimpleSAML\XML\XsNamespace as NS; use function array_diff; use function array_map; @@ -100,25 +101,25 @@ protected static function getAttributesNSFromXML(DOMElement $xml, string|array $ // Validate namespace value if (!is_array($namespace)) { // Must be one of the predefined values - Assert::oneOf($namespace, C::XS_ANY_NS); + Assert::oneOf($namespace, NS::cases()); - if ($namespace === C::XS_ANY_NS_ANY) { + if ($namespace === NS::ANY) { foreach ($xml->attributes as $a) { $attributes[] = new Attribute($a->namespaceURI, $a->prefix, $a->localName, $a->nodeValue); } - } elseif ($namespace === C::XS_ANY_NS_LOCAL) { + } elseif ($namespace === NS::LOCAL) { foreach ($xml->attributes as $a) { if ($a->namespaceURI === null) { $attributes[] = new Attribute($a->namespaceURI, $a->prefix, $a->localName, $a->nodeValue); } } - } elseif ($namespace === C::XS_ANY_NS_OTHER) { + } elseif ($namespace === NS::OTHER) { foreach ($xml->attributes as $a) { if (!in_array($a->namespaceURI, [static::NS, null], true)) { $attributes[] = new Attribute($a->namespaceURI, $a->prefix, $a->localName, $a->nodeValue); } } - } elseif ($namespace === C::XS_ANY_NS_TARGET) { + } elseif ($namespace === NS::TARGET) { foreach ($xml->attributes as $a) { if ($a->namespaceURI === static::NS) { $attributes[] = new Attribute($a->namespaceURI, $a->prefix, $a->localName, $a->nodeValue); @@ -129,16 +130,16 @@ protected static function getAttributesNSFromXML(DOMElement $xml, string|array $ // Array must be non-empty and cannot contain ##any or ##other Assert::notEmpty($namespace); Assert::allStringNotEmpty($namespace); - Assert::allNotSame($namespace, C::XS_ANY_NS_ANY); - Assert::allNotSame($namespace, C::XS_ANY_NS_OTHER); + Assert::allNotSame($namespace, NS::ANY); + Assert::allNotSame($namespace, NS::OTHER); // Replace the ##targetedNamespace with the actual namespace - if (($key = array_search(C::XS_ANY_NS_TARGET, $namespace)) !== false) { + if (($key = array_search(NS::TARGET, $namespace)) !== false) { $namespace[$key] = static::NS; } // Replace the ##local with null - if (($key = array_search(C::XS_ANY_NS_LOCAL, $namespace)) !== false) { + if (($key = array_search(NS::LOCAL, $namespace)) !== false) { $namespace[$key] = null; } @@ -170,13 +171,12 @@ protected function setAttributesNS(array $attributes): void // Validate namespace value if (!is_array($namespace)) { // Must be one of the predefined values - Assert::oneOf($namespace, C::XS_ANY_NS); + Assert::oneOf($namespace, NS::cases()); } else { // Array must be non-empty and cannot contain ##any or ##other Assert::notEmpty($namespace); - Assert::allStringNotEmpty($namespace); - Assert::allNotSame($namespace, C::XS_ANY_NS_ANY); - Assert::allNotSame($namespace, C::XS_ANY_NS_OTHER); + Assert::allNotSame($namespace, NS::ANY); + Assert::allNotSame($namespace, NS::OTHER); } // Get namespaces for all attributes @@ -191,7 +191,7 @@ function (Attribute $attr) { $attributes, ); - if ($namespace === C::XS_ANY_NS_LOCAL) { + if ($namespace === NS::LOCAL) { // If ##local then all namespaces must be null Assert::allNull($actual_namespaces); } elseif (is_array($namespace)) { @@ -199,12 +199,12 @@ function (Attribute $attr) { $allowed_namespaces = $namespace; // Replace the ##targetedNamespace with the actual namespace - if (($key = array_search(C::XS_ANY_NS_TARGET, $allowed_namespaces)) !== false) { + if (($key = array_search(NS::TARGET, $allowed_namespaces)) !== false) { $allowed_namespaces[$key] = static::NS; } // Replace the ##local with null - if (($key = array_search(C::XS_ANY_NS_LOCAL, $allowed_namespaces)) !== false) { + if (($key = array_search(NS::LOCAL, $allowed_namespaces)) !== false) { $allowed_namespaces[$key] = null; } @@ -221,10 +221,10 @@ function (Attribute $attr) { // All attributes must be namespaced, ergo non-null Assert::allNotNull($actual_namespaces); - if ($namespace === C::XS_ANY_NS_OTHER) { + if ($namespace === NS::OTHER) { // Must be any namespace other than the parent element Assert::allNotSame($actual_namespaces, static::NS); - } elseif ($namespace === C::XS_ANY_NS_TARGET) { + } elseif ($namespace === NS::TARGET) { // Must be the same namespace as the one of the parent element Assert::allSame($actual_namespaces, static::NS); } @@ -236,9 +236,9 @@ function (Attribute $attr) { /** - * @return array|string + * @return array|\SimpleSAML\XML\XsNamespace */ - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { Assert::true( defined('static::XS_ANY_ATTR_NAMESPACE'), diff --git a/src/ExtendableElementTrait.php b/src/ExtendableElementTrait.php index 9f2dfa4..ead62b8 100644 --- a/src/ExtendableElementTrait.php +++ b/src/ExtendableElementTrait.php @@ -9,6 +9,7 @@ use SimpleSAML\Assert\Assert; use SimpleSAML\XML\Chunk; use SimpleSAML\XML\Constants as C; +use SimpleSAML\XML\XsNamespace as NS; use function array_diff; use function array_map; @@ -45,12 +46,12 @@ protected function setElements(array $elements): void // Validate namespace value if (!is_array($namespace)) { // Must be one of the predefined values - Assert::oneOf($namespace, C::XS_ANY_NS); + Assert::oneOf($namespace, NS::cases()); } else { // Array must be non-empty and cannot contain ##any or ##other Assert::notEmpty($namespace); - Assert::allNotSame($namespace, C::XS_ANY_NS_ANY); - Assert::allNotSame($namespace, C::XS_ANY_NS_OTHER); + Assert::allNotSame($namespace, NS::ANY); + Assert::allNotSame($namespace, NS::OTHER); } // Get namespaces for all elements @@ -66,7 +67,7 @@ function (ElementInterface $elt) { $elements ); - if ($namespace === C::XS_ANY_NS_LOCAL) { + if ($namespace === NS::LOCAL) { // If ##local then all namespaces must be null Assert::allNull($actual_namespaces); } elseif (is_array($namespace)) { @@ -74,12 +75,12 @@ function (ElementInterface $elt) { $allowed_namespaces = $namespace; // Replace the ##targetedNamespace with the actual namespace - if (($key = array_search(C::XS_ANY_NS_TARGET, $allowed_namespaces)) !== false) { + if (($key = array_search(NS::TARGET, $allowed_namespaces)) !== false) { $allowed_namespaces[$key] = static::NS; } // Replace the ##local with null - if (($key = array_search(C::XS_ANY_NS_LOCAL, $allowed_namespaces)) !== false) { + if (($key = array_search(NS::LOCAL, $allowed_namespaces)) !== false) { $allowed_namespaces[$key] = null; } @@ -92,11 +93,11 @@ function (ElementInterface $elt) { static::NS, ), ); - } elseif ($namespace === C::XS_ANY_NS_OTHER) { + } elseif ($namespace === NS::OTHER) { // Must be any namespace other than the parent element, excluding elements with no namespace Assert::notInArray(null, $actual_namespaces); Assert::allNotSame($actual_namespaces, static::NS); - } elseif ($namespace === C::XS_ANY_NS_TARGET) { + } elseif ($namespace === NS::TARGET) { // Must be the same namespace as the one of the parent element Assert::allSame($actual_namespaces, static::NS); } else { @@ -119,9 +120,9 @@ public function getElements(): array /** - * @return array|string + * @return array|\SimpleSAML\XML\XsNamespace */ - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { Assert::true( defined('static::XS_ANY_ELT_NAMESPACE'), diff --git a/src/XsNamespace.php b/src/XsNamespace.php new file mode 100644 index 0000000..3d4170b --- /dev/null +++ b/src/XsNamespace.php @@ -0,0 +1,18 @@ +expectException(AssertionFailedException::class); - new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string - { - return 'wrong'; - } - }; - } - - /** */ public function testIllegalNamespaceComboThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return [C::XS_ANY_NS_OTHER, C::XS_ANY_NS_ANY]; + return [NS::OTHER, NS::ANY]; } }; } @@ -102,7 +88,7 @@ public function testEmptyNamespaceArrayThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { return []; } @@ -115,13 +101,13 @@ public function getAttributeNamespace(): array|string public function testOtherNamespacePassingOtherSucceeds(): void { $c = new class ([self::$other]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_OTHER; + return NS::OTHER; } }; - $this->assertEquals(C::XS_ANY_NS_OTHER, $c->getAttributeNamespace()); + $this->assertEquals(NS::OTHER, $c->getAttributeNamespace()); } @@ -131,9 +117,9 @@ public function testOtherNamespacePassingLocalThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$local]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_OTHER; + return NS::OTHER; } }; } @@ -144,13 +130,13 @@ public function getAttributeNamespace(): array|string public function testTargetNamespacePassingTargetSucceeds(): void { $c = new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_TARGET; + return NS::TARGET; } }; - $this->assertEquals(C::XS_ANY_NS_TARGET, $c->getAttributeNamespace()); + $this->assertEquals(NS::TARGET, $c->getAttributeNamespace()); } @@ -159,13 +145,13 @@ public function getAttributeNamespace(): array|string public function testTargetNamespacePassingTargetArraySucceeds(): void { $c = new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return [C::XS_ANY_NS_TARGET]; + return [NS::TARGET]; } }; - $this->assertEquals([C::XS_ANY_NS_TARGET], $c->getAttributeNamespace()); + $this->assertEquals([NS::TARGET], $c->getAttributeNamespace()); } @@ -174,13 +160,13 @@ public function getAttributeNamespace(): array|string public function testTargetNamespacePassingTargetArraySucceedsWithLocal(): void { $c = new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return [C::XS_ANY_NS_TARGET, C::XS_ANY_NS_LOCAL]; + return [NS::TARGET, NS::LOCAL]; } }; - $this->assertEquals([C::XS_ANY_NS_TARGET, C::XS_ANY_NS_LOCAL], $c->getAttributeNamespace()); + $this->assertEquals([NS::TARGET, NS::LOCAL], $c->getAttributeNamespace()); } @@ -190,9 +176,9 @@ public function testTargetNamespacePassingOtherThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$other]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_TARGET; + return NS::TARGET; } }; } @@ -203,13 +189,13 @@ public function getAttributeNamespace(): array|string public function testLocalNamespacePassingLocalSucceeds(): void { $c = new class ([self::$local]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; - $this->assertEquals(C::XS_ANY_NS_LOCAL, $c->getAttributeNamespace()); + $this->assertEquals(NS::LOCAL, $c->getAttributeNamespace()); } @@ -218,13 +204,13 @@ public function getAttributeNamespace(): array|string public function testLocalNamespacePassingLocalArraySucceeds(): void { $c = new class ([self::$local]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return [C::XS_ANY_NS_LOCAL]; + return [NS::LOCAL]; } }; - $this->assertEquals([C::XS_ANY_NS_LOCAL], $c->getAttributeNamespace()); + $this->assertEquals([NS::LOCAL], $c->getAttributeNamespace()); } @@ -234,9 +220,9 @@ public function testLocalNamespacePassingTargetThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$target]) extends ExtendableAttributesElement { - public function getAtributeNamespace(): array|string + public function getAtributeNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; } @@ -249,9 +235,9 @@ public function testLocalNamespacePassingOtherThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$other]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; } @@ -262,13 +248,13 @@ public function getAttributeNamespace(): array|string public function testAnyNamespacePassingTargetSucceeds(): void { $c = new class ([self::$target]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_ANY; + return NS::ANY; } }; - $this->assertEquals(C::XS_ANY_NS_ANY, $c->getAttributeNamespace()); + $this->assertEquals(NS::ANY, $c->getAttributeNamespace()); } @@ -277,12 +263,12 @@ public function getAttributeNamespace(): array|string public function testAnyNamespacePassingOtherSucceeds(): void { $c = new class ([self::$other]) extends ExtendableAttributesElement { - public function getAttributeNamespace(): array|string + public function getAttributeNamespace(): array|NS { - return C::XS_ANY_NS_ANY; + return NS::ANY; } }; - $this->assertEquals(C::XS_ANY_NS_ANY, $c->getAttributeNamespace()); + $this->assertEquals(NS::ANY, $c->getAttributeNamespace()); } } diff --git a/tests/XML/ExtendableElementTraitTest.php b/tests/XML/ExtendableElementTraitTest.php index fe6cccd..c2efe83 100644 --- a/tests/XML/ExtendableElementTraitTest.php +++ b/tests/XML/ExtendableElementTraitTest.php @@ -8,9 +8,9 @@ use SimpleSAML\Assert\AssertionFailedException; use SimpleSAML\Test\XML\ExtendableElement; use SimpleSAML\XML\Chunk; -use SimpleSAML\XML\Constants as C; use SimpleSAML\XML\DOMDocumentFactory; use SimpleSAML\XML\ElementInterface; +use SimpleSAML\XML\XsNamespace as NS; use function dirname; @@ -64,29 +64,15 @@ public static function setUpBeforeClass(): void } - /** - */ - public function testInvalidNamespaceThrowsAnException(): void - { - $this->expectException(AssertionFailedException::class); - new class ([]) extends ExtendableElement { - public function getElementNamespace(): array|string - { - return 'wrong'; - } - }; - } - - /** */ public function testIllegalNamespaceComboThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return [C::XS_ANY_NS_OTHER, C::XS_ANY_NS_ANY]; + return [NS::OTHER, NS::ANY]; } }; } @@ -98,7 +84,7 @@ public function testEmptyNamespaceArrayThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { return []; } @@ -111,13 +97,13 @@ public function getElementNamespace(): array|string public function testOtherNamespacePassingOtherSucceeds(): void { $c = new class ([self::$other]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_OTHER; + return NS::OTHER; } }; - $this->assertEquals(C::XS_ANY_NS_OTHER, $c->getElementNamespace()); + $this->assertEquals(NS::OTHER, $c->getElementNamespace()); } @@ -127,9 +113,9 @@ public function testOtherNamespacePassingLocalThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$local]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_OTHER; + return NS::OTHER; } }; } @@ -140,13 +126,13 @@ public function getElementNamespace(): array|string public function testTargetNamespacePassingTargetSucceeds(): void { $c = new class ([self::$target]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_TARGET; + return NS::TARGET; } }; - $this->assertEquals(C::XS_ANY_NS_TARGET, $c->getElementNamespace()); + $this->assertEquals(NS::TARGET, $c->getElementNamespace()); } @@ -155,13 +141,13 @@ public function getElementNamespace(): array|string public function testTargetNamespacePassingTargetArraySucceeds(): void { $c = new class ([self::$target]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return [C::XS_ANY_NS_TARGET]; + return [NS::TARGET]; } }; - $this->assertEquals([C::XS_ANY_NS_TARGET], $c->getElementNamespace()); + $this->assertEquals([NS::TARGET], $c->getElementNamespace()); } @@ -170,13 +156,13 @@ public function getElementNamespace(): array|string public function testTargetNamespacePassingTargetArraySucceedsWithLocal(): void { $c = new class ([self::$target]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return [C::XS_ANY_NS_TARGET, C::XS_ANY_NS_LOCAL]; + return [NS::TARGET, NS::LOCAL]; } }; - $this->assertEquals([C::XS_ANY_NS_TARGET, C::XS_ANY_NS_LOCAL], $c->getElementNamespace()); + $this->assertEquals([NS::TARGET, NS::LOCAL], $c->getElementNamespace()); } @@ -186,9 +172,9 @@ public function testTargetNamespacePassingOtherThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$other]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_TARGET; + return NS::TARGET; } }; } @@ -199,13 +185,13 @@ public function getElementNamespace(): array|string public function testLocalNamespacePassingLocalSucceeds(): void { $c = new class ([self::$local]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; - $this->assertEquals(C::XS_ANY_NS_LOCAL, $c->getElementNamespace()); + $this->assertEquals(NS::LOCAL, $c->getElementNamespace()); } @@ -214,13 +200,13 @@ public function getElementNamespace(): array|string public function testLocalNamespacePassingLocalArraySucceeds(): void { $c = new class ([self::$local]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return [C::XS_ANY_NS_LOCAL]; + return [NS::LOCAL]; } }; - $this->assertEquals([C::XS_ANY_NS_LOCAL], $c->getElementNamespace()); + $this->assertEquals([NS::LOCAL], $c->getElementNamespace()); } @@ -230,9 +216,9 @@ public function testLocalNamespacePassingTargetThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$target]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; } @@ -244,9 +230,9 @@ public function testLocalNamespacePassingOtherThrowsAnException(): void { $this->expectException(AssertionFailedException::class); new class ([self::$other]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_LOCAL; + return NS::LOCAL; } }; } @@ -257,13 +243,13 @@ public function getElementNamespace(): array|string public function testAnyNamespacePassingLocalSucceeds(): void { $c = new class ([self::$local]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_ANY; + return NS::ANY; } }; - $this->assertEquals(C::XS_ANY_NS_ANY, $c->getElementNamespace()); + $this->assertEquals(NS::ANY, $c->getElementNamespace()); } @@ -272,13 +258,13 @@ public function getElementNamespace(): array|string public function testAnyNamespacePassingTargetSucceeds(): void { $c = new class ([self::$target]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_ANY; + return NS::ANY; } }; - $this->assertEquals(C::XS_ANY_NS_ANY, $c->getElementNamespace()); + $this->assertEquals(NS::ANY, $c->getElementNamespace()); } @@ -287,12 +273,12 @@ public function getElementNamespace(): array|string public function testAnyNamespacePassingOtherSucceeds(): void { $c = new class ([self::$other]) extends ExtendableElement { - public function getElementNamespace(): array|string + public function getElementNamespace(): array|NS { - return C::XS_ANY_NS_ANY; + return NS::ANY; } }; - $this->assertEquals(C::XS_ANY_NS_ANY, $c->getElementNamespace()); + $this->assertEquals(NS::ANY, $c->getElementNamespace()); } }