473,734 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# RSS feed generator & building the guid element

2 New Member
Windows XP Pro
VS 2005 & C# (I'm fairly new to C# but have doing VB.Net going on 2yrs and VB6 for 5yrs.)

I'm using C# to build a custom RSS generator. I'm having trouble building the guid element for each item node in my feed. Some items do not have the "link" node because the description element is the content. So using the "link" as the guid will not work in my case, as some sites suggest and as feedvalidator.o rg complains when I do not have one. Plus the content may change so I'm attempting to set the isPermaLink attribute to false to instruct the RSS readers/subscribers not to use this field; it's just there for uniqueness.

Here is what I need:
<guid isPermaLink="fa lse">69DA.....3 83D26EAF0</guid>

I have tried building a "guid" object but when its serialized it takes each property and makes them attributes of the guid element. Like this:
<guid guid="69DA..... .383D26EAF0" isPermaLink="fa lse" />
Which is represented by the code snippet below.
Here's my "guid" element:
Expand|Select|Wrap|Line Numbers
  1. [XmlElement("guid")]
  2. public guidAttributes Guid
  3.  get    { return _guid;     }
  4.  set    { _guid = value; }
  5. }
  6.  
Here is my guidAttributes class:
Expand|Select|Wrap|Line Numbers
  1. public class guidAttributes
  2. {
  3.  private string _guid;
  4.  private bool _isPermaLink;
  5.  
  6.  [XmlAttribute("guid")]
  7.  public string Guid
  8.  {
  9.   get {  return _guid; }
  10.   set { _guid = value; }
  11.  }
  12.  
  13.  [XmlAttribute("isPermaLink")]
  14.  public bool isPermaLink
  15.  {
  16.   get {  return _isPermaLink; }
  17.   set { _isPermaLink = value; }
  18.  }
  19. }
  20.  
Changing the "guid" property above from Attribute to element like this:
Expand|Select|Wrap|Line Numbers
  1. [XmlElement("guid")]
  2.  public string Guid
  3.  
Produces this output:
<guid isPermaLink="fa lse">
<guid>69DA..... 383D26EAF0</guid>
</guid>

I'm close but not there and just need a bit of help to put all the pieces together.

Any help is greatly appreciated.

Thanks,

Michael
Nov 10 '06 #1
2 16190
Troll
2 New Member
Well a co-worker helped me out. Pretty simple in retrospect. I would post the code but everyone else must know how to do it or have no need for the implementation. If you do need to see the code, let me know.

Mike
Nov 16 '06 #2
karlomanio
1 New Member
I'd like to see your solution.

Thanks,
karlomanio
Jan 14 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
4054
by: Mr. Smith | last post by:
Hello all, My code can successfully open, write to, format and save several worksheets in a workbook then save it by a given name, close and quit excel. My problem is that if I try and do it again, Excel hangs. OR if I open Excel again (say from a desktop icon) before I close Access, Excel hangs. (this has happened for both 97 & 2000 for me) I of course thought that I mustn't be unloading a variable properly.
1
5052
by: Mike Logan | last post by:
I have a schema that defines my messages and objects. I then have a WSDL that defines the web services. I have my sample XSD, sample WSDL, and the code generated from WSDL.exe. In the generated code from WSDL.exe, the "applicationList" object is not a array or "application", which is what it should be, correct? Thanks for the help. <?xml version="1.0" encoding="utf-8" ?> <xs:schema targetNamespace="http://me.com/xml/xsd/AppSec1.xsd"
5
4470
by: Al | last post by:
Hi all We have created a xml file that imports a single project using the Import element. This project compiles to a class library, but has references to two other projects that are also class libraries. We are having a path reference issue for the depending projects; if the build is started in another directory than that of the imported project. (It's a simple cannot find project xyz.csproj, build fails.) If we place the xml file in...
2
2438
by: Sky | last post by:
Hello: I'm trying to make sense of snk files, when to use, under what conditions to regenerate new ones,...can someone take a look if these statemes make sense? And then the final questions at the end that they first statements bring up in my mind... a) Because two developers, unbeknownst to each other, can end up releaseing different dll's with the same name, one should sign an assembly with a unique tag. right?
4
13004
by: Billy Barth | last post by:
I would like to create a RSS feed from my Access Database. I have an Access table for news which has the article title, date, and story in it. What I would like to do is pull the data from there into an xml file to create the RSS feed, so when users upload a news story it automatically updates in the xml file. Can this be done with asp? and where should I look for more information. Thanks, This is a great group. -- Posted via a free...
8
4850
by: mc | last post by:
I would like to be able to send from an ASP.NET page an email which when recieved takes the form of a "Sharing Invitation for a RSS Feed" (http://office.microsoft.com/en-us/outlook/HA101595391033.aspx) I've found a MSDN article about it (http://msdn2.microsoft.com/en-us/library/bb176432.aspx) but that example is presented as a vb(a) script from within outlook. Can this functionality be emulated from sending an email from C#? TIA
5
2435
by: Ed Flecko | last post by:
Hi folks, I'm trying to figure out this whole RSS feed thing. I've created my .xml file to use for my feed, and my browsers "recognize" that I have an RSS feed, and you can subscribe, etc., etc. Here's why I "think" I want to use an RSS feed, and what I'm confused about. I have one file (and one file only) on my web site that changes
1
2183
by: Tarik Monem | last post by:
Here's the code for the index.xml file on the blogger <?xml version="1.0" encoding="<$MTPublishCharset$>"?> <rss version="2.0"> <channel> <title><$MTBlogName remove_html="1" encode_xml="1"$></title> <link><$MTBlogURL$></link> <description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
4
1953
by: Blake Garner | last post by:
I'm looking for suggestions on how to approach generating rss feed ..xml files using python. What modules to people recommend I start with? Thanks! Blake
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.