function _views_rss_process_namespaces in Views RSS 6.2
Same name and namespace in other branches
- 8.3 views_rss.module \_views_rss_process_namespaces()
- 8.2 views_rss.module \_views_rss_process_namespaces()
- 7.2 views_rss.module \_views_rss_process_namespaces()
Add namespaces not defined by any hook_views_rss_namespaces(), but used in any of defined <channel> or <item> elements. Let's also add "xmlns" prefix by default to such namespaces.
File
- ./
views_rss.module, line 107 - Module providing fields-based views style plugin for RSS feed generation.
Code
function _views_rss_process_namespaces($namespaces) {
foreach (views_rss_get('channel_elements') as $module => $elements) {
foreach (array_keys($elements) as $element) {
list($namespace, $element_name) = views_rss_extract_element_names($element);
if ($namespace && !isset($namespaces[$module][$namespace])) {
$namespaces[$module][$namespace] = array(
'prefix' => 'xmlns',
'uri' => NULL,
);
}
}
}
foreach (views_rss_get('item_elements') as $module => $elements) {
foreach (array_keys($elements) as $element) {
list($namespace, $element_name) = views_rss_extract_element_names($element);
if ($namespace && !isset($namespaces[$module][$namespace])) {
$namespaces[$module][$namespace] = array(
'prefix' => 'xmlns',
'uri' => NULL,
);
}
}
}
return $namespaces;
}