Say I generate rss page using django's built-in syndication framework.
<channel xmlns:content="http://purl.org/rss/1.0/modules/content/">
<title>laike9m's blog</title>
<link>http://example.com/blog/rss</link>
<description>Update on laike9m blog's articles.</description>
<atom:link rel="self" href="http://example.com/blog/rss/"/>
<language>en-us</language>
...
I want to change the content of <language> tag, how do I do it?
I tried define custom feed:
class ExtendedRssFeed(Rss201rev2Feed):
def add_root_elements(self, handler):
super(ExtendedRssFeed, self).add_root_elements(handler)
handler.addQuickElement('language', 'zh-CN')
It doesn't replace but add another <language> tag.
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel xmlns:content="http://purl.org/rss/1.0/modules/content/">
<title>laike9m's blog</title>
<link>http://example.com/blog/rss</link>
<description>Update on laike9m blog's articles.</description>
<atom:link rel="self" href="http://example.com/blog/rss/"/>
<language>en-us</language>
<language>zh-CN</language>
Managed to do this by overriding
__init__for my Feed like so: