firstChild; $n !== NULL; $n = $n->nextSibling) { if (!($n instanceof DOMElement)) { continue; } if ($n->namespaceURI !== XMLSecurityDSig::XMLDSIGNS) { $this->data[] = new SAML2_XML_Chunk($n); continue; } switch ($n->localName) { case 'X509Certificate': $this->data[] = new SAML2_XML_ds_X509Certificate($n); break; default: $this->data[] = new SAML2_XML_Chunk($n); break; } } } /** * Convert this X509Data element to XML. * * @param DOMElement $parent The element we should append this X509Data element to. */ public function toXML(DOMElement $parent) { assert('is_array($this->data)'); $doc = $parent->ownerDocument; $e = $doc->createElementNS(XMLSecurityDSig::XMLDSIGNS, 'ds:X509Data'); $parent->appendChild($e); foreach ($this->data as $n) { $n->toXML($e); } return $e; } }