-1

试图ds:X509Certificate在 PHP 中获取节点值。我能够导航到IDPSSODescriptor标签,任何关于如何访问子节点值的指针。

<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代码,

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

我试过了,

$xml = new SimpleXMLElement($idp_xml->IDPSSODescriptor);
$data = (string) $xml->ds:Signature[0]->ds:KeyInfo->ds:X509Data->ds:X509Certificate.
4

1 回答 1

-1

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

$childNode = $idp_xml->IDPSSODescriptor->children();
于 2013-05-16T22:18:32.593 回答