Skip to main content

W3CGeoFeed

This class extends the RSS 2.0 feed implementation to support W3C Geo spatial metadata. It automatically adds the necessary W3C Geo namespace attributes to the feed and incorporates geographical elements into both the root and individual feed items. This allows for the representation of latitude and longitude coordinates using the W3C WGS84 positioning schema.

Methods


rss_attributes()

@classmethod
def rss_attributes() - > dict

Extends the standard RSS attributes to include the W3C Geo namespace declaration required for geographic positioning metadata.

Returns

TypeDescription
dictA dictionary of XML namespace attributes including the 'xmlns:geo' URI.

add_item_elements()

@classmethod
def add_item_elements(
handler: xml.sax.handler.ContentHandler,
item: dict
) - > null

Appends geographic coordinates to individual RSS items using the W3C Geo vocabulary.

Parameters

NameTypeDescription
handlerxml.sax.handler.ContentHandlerThe XML generator instance used to write the feed content.
itemdictA dictionary containing the data for a specific feed entry, including its latitude and longitude.

Returns

TypeDescription
null

add_root_elements()

@classmethod
def add_root_elements(
handler: xml.sax.handler.ContentHandler
) - > null

Adds geographic metadata to the top-level feed element to define the global position of the entire RSS channel.

Parameters

NameTypeDescription
handlerxml.sax.handler.ContentHandlerThe XML generator instance used to write the feed content.

Returns

TypeDescription
null