You are here

function _oembedprovider_formats_xml in oEmbed 6.0

Same name and namespace in other branches
  1. 8 modules/oembedprovider/oembedprovider.inc \_oembedprovider_formats_xml()
  2. 7 modules/oembedprovider/oembedprovider.inc \_oembedprovider_formats_xml()
  3. 7.0 oembedprovider/oembedprovider.inc \_oembedprovider_formats_xml()

XML formatter

1 string reference to '_oembedprovider_formats_xml'
oembedprovider_formats in ./oembedprovider.module
Returns all the registered response formats

File

./oembedprovider.inc, line 144
Functions for the oEmbed provider

Code

function _oembedprovider_formats_xml($data) {
  $doc = new DomDocument('1.0', 'utf-8');
  $oembed = $doc
    ->createElement('oembed');
  $doc
    ->appendChild($oembed);
  foreach ($data as $key => $value) {
    $e = $doc
      ->createElement($key);
    $e
      ->appendChild($doc
      ->createTextNode($value));
    $oembed
      ->appendChild($e);
  }
  return $doc
    ->saveXml();
}