* @link http://status.net/
*/
-
class XRD
{
const XML_NS = 'http://www.w3.org/2000/xmlns/';
-
+
const XRD_NS = 'http://docs.oasis-open.org/ns/xri/xrd-1.0';
const HOST_META_NS = 'http://host-meta.net/xrd/1.0';
-
+
public $expires;
public $subject;
public $host;
public $alias = array();
-
+
public $types = array();
-
+
public $links = array();
-
+
public static function parse($xml)
{
$xrd = new XRD();
error_reporting($old);
if (!$ok) {
- throw new Exception("Invalid XML");
+ // TRANS: Exception.
+ throw new Exception(_m('Invalid XML.'));
}
$xrd_element = $dom->getElementsByTagName('XRD')->item(0);
if (!$xrd_element) {
- throw new Exception("Invalid XML, missing XRD root");
+ // TRANS: Exception.
+ throw new Exception(_m('Invalid XML, missing XRD root.'));
}
// Check for host-meta host
case 'Subject':
$xrd->subject = $node->nodeValue;
break;
-
+
case 'Alias':
$xrd->alias[] = $node->nodeValue;
break;
if ($this->host) {
$xs->element('hm:Host', array('xmlns:hm' => XRD::HOST_META_NS), $this->host);
}
-
+
if ($this->expires) {
$xs->element('Expires', null, $this->expires);
}
}
$xs->elementEnd('Link');
}
-
+
$xs->elementEnd('XRD');
return $xs->getString();
{
return array();
}
-
+
function parseLink($element)
{
$link = array();
return $link;
}
}
-