-1

Trying to get the node value of ds:X509Certificate in PHP. I am able to navigate till IDPSSODescriptor tag, any pointers on how to access child node values.

<EntityDescriptor>
      <IDPSSODescriptor>
        <ds:Signature >
             <ds:SignedInfo>..</ds:SignedInfo>
             <ds:SignatureValue>..</ds:SignatureValue>
              <ds:KeyInfo>
                 <ds:X509Data>
                   <ds:X509Certificate/>
                 </ds:X509Data>
               </ds:KeyInfo>
         <test>
         <test2>
      </IDPSSODescriptor>
</EntityDescriptor>

php code working so far,

$data = $idp_xml->IDPSSODescriptor->attributes()->ID; 

I tried,

$xml = new SimpleXMLElement($idp_xml->IDPSSODescriptor);
$data = (string) $xml->ds:Signature[0]->ds:KeyInfo->ds:X509Data->ds:X509Certificate.
2
  • Hi just read your request but xml file does not seemed to be well formed can you supply more details of your xml files Commented May 16, 2013 at 21:07
  • Error in your XML, ds is a namespace-prefix, and it is not defined in your snippet, see xmlvalidation.com This is probably the reason why you cannot access it. Commented May 18, 2013 at 16:19

1 Answer 1

-1

http://www.php.net/manual/en/simplexmlelement.children.php

$childNode = $idp_xml->IDPSSODescriptor->children();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.