@@ -71,18 +71,20 @@ XML data
7171sub new_from_xml {
7272 my ($class , %args ) = @_ ;
7373
74- my $xpath = XML::XPath-> new( xml => no_comments($args {xml }) );
75- $xpath -> set_namespace(' saml' , ' urn:oasis:names:tc:SAML:2.0:assertion' );
76- $xpath -> set_namespace(' samlp' , ' urn:oasis:names:tc:SAML:2.0:protocol' );
74+ my $dom = no_comments($args {xml });
75+
76+ my $xpath = XML::LibXML::XPathContext-> new($dom );
77+ $xpath -> registerNs(' saml' , ' urn:oasis:names:tc:SAML:2.0:assertion' );
78+ $xpath -> registerNs(' samlp' , ' urn:oasis:names:tc:SAML:2.0:protocol' );
7779
7880 my $self = $class -> new(
79- id => $xpath -> findvalue(' /samlp:LogoutResponse/@ID' )-> value ,
80- response_to => $xpath -> findvalue(' /samlp:LogoutResponse/@InResponseTo' )-> value ,
81- destination => $xpath -> findvalue(' /samlp:LogoutResponse/@Destination' )-> value ,
82- session => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:SessionIndex' )-> value ,
83- issuer => $xpath -> findvalue(' /samlp:LogoutResponse/saml:Issuer' )-> value ,
84- status => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:Status/samlp:StatusCode/@Value' )-> value ,
85- substatus => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:Status/samlp:StatusCode/samlp:StatusCode/@Value' )-> value ,
81+ id => $xpath -> findvalue(' /samlp:LogoutResponse/@ID' ),
82+ response_to => $xpath -> findvalue(' /samlp:LogoutResponse/@InResponseTo' ),
83+ destination => $xpath -> findvalue(' /samlp:LogoutResponse/@Destination' ),
84+ session => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:SessionIndex' ),
85+ issuer => $xpath -> findvalue(' /samlp:LogoutResponse/saml:Issuer' ),
86+ status => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:Status/samlp:StatusCode/@Value' ),
87+ substatus => $xpath -> findvalue(' /samlp:LogoutResponse/samlp:Status/samlp:StatusCode/samlp:StatusCode/@Value' ),
8688 );
8789
8890 return $self ;
0 commit comments