You are here

function views_plugin_style_rss_fields::xml_namespace in Views RSS 7

Same name and namespace in other branches
  1. 6 views/views_plugin_style_rss_fields.inc \views_plugin_style_rss_fields::xml_namespace()

Convenience method: return an XML Namespace for a given element.

Parameters

$elem: An XML element like 'title' or 'dc:creator'

Return value

An array where with a local and a global namespace identifier. Returns FALSE if no corresponding namespace could be found.

File

views/views_plugin_style_rss_fields.inc, line 269

Class

views_plugin_style_rss_fields
Extend the view_plugin_style class to provide an RSS view style.

Code

function xml_namespace($elem) {
  $e = explode(':', $elem);
  if (is_array($e)) {
    $local = array_shift($e);
    $namespaces = $this
      ->xml_namespaces($local);
    if (isset($namespaces[$local])) {
      return array(
        'local' => $local,
        'namespace' => $namespaces[$local],
      );
    }
  }
  return FALSE;
}