+ switch ($this->data_type) {
+ case 'application/atom+xml':
+ if ($dom->documentElement->namespaceURI !== Activity::ATOM
+ || $dom->documentElement->tagName !== 'entry') {
+ throw new ServerException(_m('Salmon post must be an Atom entry.'));
+ }
+ $prov = $dom->createElementNS(self::NS, 'me:provenance');
+ $prov->setAttribute('xmlns:me', self::NS);
+ $data = $dom->createElementNS(self::NS, 'me:data', $this->data);
+ $data->setAttribute('type', $this->data_type);
+ $prov->appendChild($data);
+ $enc = $dom->createElementNS(self::NS, 'me:encoding', $this->encoding);
+ $prov->appendChild($enc);
+ $alg = $dom->createElementNS(self::NS, 'me:alg', $this->alg);
+ $prov->appendChild($alg);
+ $sig = $dom->createElementNS(self::NS, 'me:sig', $this->getSignature());
+ $prov->appendChild($sig);
+
+ $dom->documentElement->appendChild($prov);
+ break;
+ default:
+ throw new ServerException('Unknown Salmon payload data type');