Desi said:
XML gurus,
I need help in converting my feedreader subscription XML file to an
OPML file. I have no idea how to do that.
Something like this (feedreader2opml.xsl) should do:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl
utput method="xml" />
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="feeds">
<opml version="1.0">
<head>
<title>Converted from feedreader subscriptions using
feedreader2opml.xsl</title>
</head>
<body>
<xsl:apply-templates />
</body>
</opml>
</xsl:template>
<xsl:template match="item">
<outline type="rss">
<xsl:choose>
<xsl:when test="title/text() != ''">
<xsl:attribute name="text"><xsl:value-of
select="normalize-space(title/text())" /></xsl:attribute>
<xsl:attribute name="title"><xsl:value-of
select="normalize-space(title/text())" /></xsl:attribute>
</xsl:when>
<xsl
therwise />
</xsl:choose>
<xsl:choose>
<xsl:when test="htmlurl/text() != ''">
<xsl:attribute name="htmlurl"><xsl:value-of
select="normalize-space(htmlurl/text())" /></xsl:attribute>
</xsl:when>
<xsl
therwise />
</xsl:choose>
<xsl:choose>
<xsl:when test="link/text() != ''">
<xsl:attribute name="xmlurl"><xsl:value-of
select="normalize-space(link/text())" /></xsl:attribute>
</xsl:when>
<xsl
therwise />
</xsl:choose>
</outline>
</xsl:template>
<xsl:template match="*" />
</xsl:stylesheet>