implemented functionality for custom namespaces

This commit is contained in:
Max Nowack
2014-11-11 14:08:13 +01:00
parent 86716e2d8c
commit 4bb6259ebf

View File

@@ -108,6 +108,10 @@ function generateXML (data){
version: '2.0'
};
for(var name in data.customNamespaces) {
_attr['xmlns:' + name] = data.customNamespaces[name];
}
//only add namespace if GeoRSS is true
if(data.geoRSS){
_attr['xmlns:geo'] = 'http://www.w3.org/2003/01/geo/wgs84_pos#';
@@ -142,6 +146,7 @@ function RSS (options, items) {
this.ttl = options.ttl;
//option to return feed as GeoRSS is set automatically if feed.lat/long is used
this.geoRSS = options.geoRSS || false;
this.customNamespaces = options.customNamespaces || {};
this.custom = options.custom || [];
this.items = items || [];