1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
<?php
namespace SimpleSAML\Module\adfs\SAML2\XML\fed;
/**
* Class representing fed Endpoint.
*
* @package SimpleSAMLphp
*/
class Endpoint
{
/**
* Add this endpoint to an XML element.
*
* @param \DOMElement $parent The element we should append this endpoint to.
* @param string $name The name of the element we should create.
* @param string $address
* @return \DOMElement
*/
public static function appendXML(\DOMElement $parent, $name, $address)
{
assert(is_string($name));
assert(is_string($address));
$e = $parent->ownerDocument->createElement($name);
$parent->appendChild($e);
$endpoint = $parent->ownerDocument->createElement('EndpointReference');
$endpoint->setAttribute('xmlns', 'http://www.w3.org/2005/08/addressing');
$e->appendChild($endpoint);
$address = $parent->ownerDocument->createElement('Address', $address);
$endpoint->appendChild($address);
return $e;
}
}
|