.NET Brain Droppings

I'm a Microsoft Certified Architect (MCA)... Feel free to ask me about the program...

OPML to Blog Roll XSLT Transformation

I got frustrated trying to keep up with my blog roll, so I decided to write a chunk of xslt to create one on the fly.  This no-frills code snippet will generate a HTML fragment in the following format:

href="http://www.dotnetweblogs.com/dbrowning">.NET Brain Droppings

One will be generated for each entry in your opml file (categories are skipped).

Hope this helps everyone keep thier blog roll current!  =)


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" standalone="no" omit-xml-declaration="yes" />
<xsl:template match="/">
    
    <xsl:apply-templates select="//outline" />
</xsl:template>
<xsl:template match="outline">
    
    <xsl:choose>
        <xsl:when test="@type='rss'">
            <a href="{@htmlUrl}"><xsl:value-of select="@title" />a><br/>
        xsl:when>
    xsl:choose>
</xsl:template>
</xsl:stylesheet>
The permalink to this code snippet can be found here.
[Listening To: 38 - Revco]
Leave a Comment

(required) 

(required) 

(optional)

(required)