How to convert XML subscription file to OPML

D

Desi

XML gurus,

I need help in converting my feedreader subscription XML file to an
OPML file. I have no idea how to do that.

Thanks in advance.
 
K

Klaus Johannes Rusch

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:eek: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:eek: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:eek: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:eek:therwise />
</xsl:choose>
</outline>
</xsl:template>

<xsl:template match="*" />
</xsl:stylesheet>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top