-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.
hakre
  • 193,403
  • 52
  • 435
  • 836
User
  • 135
  • 2
  • 4
  • 13
  • Hi just read your request but xml file does not seemed to be well formed can you supply more details of your xml files – Artful_dodger May 16 '13 at 21:07
  • Error in your XML, `ds` is a `namespace-prefix`, and it is not defined in your snippet, see http://www.xmlvalidation.com This is probably the reason why you cannot access it. – michi May 18 '13 at 16:19

1 Answers1

-1

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

$childNode = $idp_xml->IDPSSODescriptor->children();
Jeff
  • 370
  • 1
  • 2
  • 11