XSLT for SharpReader to blogroll.xml

Topics: Controls
Jul 10, 2009 at 9:15 PM

Here is the XSLT to convert a SharpReader (or other feed reader) OPML file into a blogroll.xml that is used by BE.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="xml" indent="yes"/>

  <xsl:template match="*|@* | node()">
    <xsl:copy>
      <body>
        <xsl:apply-templates select="//outline"/>
      </body>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="outline">
    <xsl:if test="@type='rss'">
      <outline xfn="contact">
        <xsl:apply-templates select="*|@*|node()"/>
      </outline>
    </xsl:if>
  </xsl:template>

</xsl:stylesheet>