This project has moved and is read-only. For the latest updates, please go here.

How Do You (or can you) Set Attributes on Tags

Topics: Developer Forum, Project Management Forum, User Forum
May 9, 2007 at 2:32 AM
Edited May 9, 2007 at 2:36 AM
I have been using the TagTooga RSS.Net component (http://www.tagtooga.com/pg/Rss-DotNet) for generating my RSS feeds. However...it has a rather large footprint (IMO). I have been looking at the RSS Toolkit as a replacement. I am having difficulty figuring out how to add attributes to the tags that you create.

For example.....for an RSS feed to be valid (http://validator.w3.org/feed/) you should have a guid tag. If this tag is not a valid/real link then you should have an attribute set on the guid tag called isPermaLink with a value of false. The below is a valid example:

<guid isPermaLink="false">f3477e3505</guid>

I can set the tag guid by simply coding: item"guid" = Guid.NewGuid().ToString().Replace("-", string.Empty).Substring(0, 10);

What I can't figure out is how to get the isPermaLink="false" attribute in the guid tag line.

Is this capability in the RSS Toolkit? If so, what do I need to do? If not, it needs to be there if you want people to be able to generate valid/compliant RSS feeds.
Jul 24, 2007 at 9:35 PM
Add the following into your .rss file within the <item></item> element (you have to put some text within the guid element so you get the Text property exposed)

<guid isPermaLink="true">tralala</guid>

then in your ashx

item.Guid.IsPermaLink = "false";
item.Guid.Text = Guid.NewGuid().ToString();