I'm a little new to rss feeds, but I can dynamically create a feed using PHP, and it works great. My problem is that sometimes the feed has no items (I limit the age of the feed to 60 days, and sometimes nothing happened during this time).
What I would expect is that I simply would not have an <item> in my xml page. However, when I do this, the feed reader (at least one Google) seems a bit worried. Although the XML correctly contains the name of the feed, it is displayed without a title.
The only way I have found so far to fix this is to introduce a dummy element, i.e. just <item><title></title></item> . Then my Google reader finds the feed name correctly and it just looks like an empty channel.
This seems to be a hockey decision, which is probably incorrect.
Is there any standard way to work with an XML representation for an empty feed?
Edit: here, that empty thread looks like
<?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/"> <channel> <title>News at Example</title> <link>http://www.example.com/feed/sample-reviews</link> <description>Latest Additions to the Sample Category</description> <dc:language>en-us</dc:language> <dc:creator>Contact Example through our "contact us" page</dc:creator> <dc:rights>Copyright 2010 Example Technologies Inc.</dc:rights> <admin:generatorAgent rdf:resource="http://www.codeigniter.com/" /> <item><title></title></item> </channel></rss>
xml php rss feeds
neomech
source share