25 \libxml_use_internal_errors(
true);
29 $xml->registerXPathNamespace(
'md',
'urn:oasis:names:tc:SAML:2.0:metadata');
30 $xml->registerXPathNamespace(
'mdui',
'urn:oasis:names:tc:SAML:metadata:ui');
32 $idps =
$xml->xpath(
'//md:EntityDescriptor[//md:IDPSSODescriptor]');
34 if ($idps && isset($idps[0])) {
35 $entityid = (string) $idps[0]->attributes(
'',
true)->entityID[0];
38 foreach (\libxml_get_errors() as $error) {
39 $this->
pushError($error->line .
': ' . $error->message);
43 $this->entityId = $entityid;
46 \libxml_clear_errors();
54 $this->errors[] = $error;