I am wondering, is it allowed for an 'item' tag in rss2 feed to have properties?
I need to add additional info to my articles in my RSS feed, like item's "weight" and "expiration", so I was thinking to adding these as properties of 'item', like this:
<item weight="2" expiration="10-11-2009">
all other usual tags here
Is this allowed or will it cause problems in RSS parsers? Is there a better way to do this?
The RSS specification is exactly that, a specification for a language, adding attributes which are not part of the initial model may cause undesirable results and for sure your code will not validate, if you want to give values which can be affected by behavior, why not use the class tag (you can have multiple classes per element) so you could have class="weight-2 expire-10_11_2009" (if that is useful), I am not sure why you would want weight or an expiry tag because you arent going to be able to override the reader behavior by default.
What do you mean by class? I thought class was an html attribute, and we are talking about RSS2
Now the reason why I need these extra tags is because I am using my own site's RSS feed for generating site's HTML. Basically I am developing a website that uses XML + XSL template. For the XML part I am using the RSS feed. This way the rss feed serves 2 purposes - it can be used by any feed reader as a feed and it is also used by visitors to my site as a source of XML. The XSL template then has instructions how to present it. The 'weight' and 'expiration' are used by my XSL template. So for example, the XSL template may have instructions to NOT show expired announcement at all, and it can have instructions to sort the list of items by weight.