Default feed.id to feed.link (if present)

This commit is contained in:
Sam Ruby 2006-09-05 20:19:48 -04:00
parent a2be5b6c2a
commit fc6e39a388
3 changed files with 4 additions and 3 deletions

View File

@ -151,7 +151,7 @@ def source(xsource, source, bozo):
""" copy source information to the entry """ """ copy source information to the entry """
xdoc = xsource.ownerDocument xdoc = xsource.ownerDocument
createTextElement(xsource, 'id', source.get('id', None)) createTextElement(xsource, 'id', source.get('id', source.get('link',None)))
createTextElement(xsource, 'icon', source.get('icon', None)) createTextElement(xsource, 'icon', source.get('icon', None))
createTextElement(xsource, 'logo', source.get('logo', None)) createTextElement(xsource, 'logo', source.get('logo', None))

View File

@ -1,6 +1,6 @@
<!-- <!--
Description: link relationship Description: link relationship
Expect: links[0].rel == 'alternate' Expect: links[0].rel == 'alternate' and id == 'http://example.com/1'
--> -->
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">

View File

@ -1,10 +1,11 @@
<!-- <!--
Description: source link Description: source link
Expect: source.links[0].href == 'http://example.com/atom.xml' Expect: source.links[0].href == 'http://example.com/atom.xml' and source.id == 'http://example.com/'
--> -->
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<link rel='self' href='http://example.com/atom.xml'/> <link rel='self' href='http://example.com/atom.xml'/>
<link href='http://example.com/'/>
<entry/> <entry/>
</feed> </feed>