Sign In/My Account | View Cart  
advertisement

Article:
 Pull Parsing in C# and Java
Subject: Returning a RSS Block
Date: 2006-10-20 06:15:41
From: Niel Bornstein
Response to: Returning a RSS Block

The problem with this approach is that rssreader.RSSToHtml() does not return anything. It expects to place its output in the XmlWriter that is passed in.


What you want to do is have the XmlWriter write to a StringWriter instead of the console:


...
StringWriter sw = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
...
rssreader.RSSToHtml(reader, writer);
return sw.ToString();


No Previous Message Previous Message Move up to Parent Message Up Next Message No Next Message


Titles Only Titles Only Newest First
  • Returning a RSS Block
    2006-10-24 01:52:23 Phil_WBC [Reply]

    Thanks, this works perfectly. It's only returning one result (the top one) from the URL though, is it possible to return more?

    • Returning a RSS Block
      2006-10-25 08:28:24 Niel Bornstein [Reply]

      That could be a problem with the specific RSS feed or some bug in my code. RSS is really under-specified, so there's no way a small snippet like this could handle all the variants that are out there. Your best bet is find another RSS library that handles everything gracefully.


Sponsored By: