rsssyndicationatom-feed

Linking to full category pages using the category tag in RSS 2.0


Using the category tag in RSS 2.0:

<category domain="http://mysite.example.com/tags">
    Science and Technology
</category>

How would I provide an additional URL to the page that shows all of the items in that category?

Since the spec doesn't appear cover this, would it be safe to invent a new attribute in my own namespace, like this:

<category domain="http://mysite.example.com/tags"
    myns:category-url="http://mysite.example.com/tags/scitech/">
    Science and Technology
</category>

Then at the top of the document:

<rss version="2.0" xmlns:myns="http://mysite.example.com/namespace/">

Is it OK to extend RSS in this way? Are any aggregators or implementations out there in the wild likely to break? Or is there an existing mechanism for linking to a category page that I should be using instead?

I'm interested in seeing how this would be done in Atom as well, but I need a solution for RSS 2.0.


Solution

  • As you notice in the comment, it just says "A RSS feed may contain elements not described on this page, only if those elements are defined in a namespace.", but says nothing about new attributes, so I'd think that it is at least against the spirit of the spec to do so.

    My understanding is that whatever is described in that page ought be considered frozen, with the exception of the ability to add namespaced elements.

    Thus, i think that the one way to add what you need is to add a new element which has to have a content matching a category and an attribute holding the URL to the page that shows all of the items in that category:

    <rss version="2.0" xmlns:myns="http://mysite.example.com/namespace/">
    <category domain="http://mysite.example.com/tags">
        Science and Technology
    </category>
    <myns:category-url url="http://mysite.example.com/tags/scitech/">
        Science and Technology
    </myns:category-url>
    

    It's not pretty but it may work