As with anything in web development, there are at least 5 ways of doing this, so this is only one method (please feel free to comment on other options). If are using .Net 2.0 I would recommend you looking at the RSSToolkit.
The need
Create a listing of hyperlinks for a blog that is on another site in .Net 1.1.
The solution
At first this sounds like an easy enough request ... just use the asp:Xml control, create an XSLT stylesheet and your done right? Yes ... it is that easy!
If you look at the samples that are used with the asp:Xml control, you'll see the most of code you need (I left the loading of the transform to the control in the code below). Here is all you need to do:
1. Add an asp:Xml control to your .aspx page where you the Html to be written to and name it 'recentEntries' (make sure you also set the runat=“server“ attribute).
2. Make sure your code behind file includes the following (you might also have other stuff in your Page_Load method) - make sure you pass the URL you need in the XmlTextReader constructor :
21 protected System.Web.UI.WebControls.Xml recentEntries;
22
23 private void Page_Load(object sender, System.EventArgs e)
24 {
25 XmlTextReader reader = new XmlTextReader("http://localhost/blog/rss.aspx");
26 XmlDocument doc = new XmlDocument();
27 doc.Load(reader);
28
29 recentEntries.Document = doc;
30 recentEntries.TransformSource = "recentEntries.xslt";
31 }
3. Add a new Xslt file to your project named 'recentEntries.xslt'
4. Make your Xslt file include the following (you might want to change the id names or the htlm output for your site):
<xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>
<xsl:preserve-space elements="*" />
<xsl:template match="/">
<xsl:element name="div">
<xsl:attribute name="id">items< FONT>xsl:attribute>
<xsl:apply-templates select="//channel/item" mode="item"/>
</xsl:element>
</xsl:template>
<xsl:template match="item" mode="item">
<xsl:element name="span">
<xsl:attribute name="id">bloglink</< FONT>xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:value-of select="title"/> - <xsl:value-of select="substring(pubDate,0,17)"/>
</xsl:element>
<xsl:element name="br"/>
</xsl:element>
</xsl:template>
< FONT></xsl:stylesheet>
Tha is all you need. Of course this is going to tie the loading of your page to the speed of the loading of the Rss file ... something you may or may not want to do.