<?xml version="1.0"?>
<xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xsl:version="1.0">

	<xsl:output method="xml" encoding="utf-8" indent="yes"/>
	<xsl:param name="bloglines-read" select="'1'"/>

	<xsl:template match="/">
	<opml version="1.0">
		<head>
			<title>Bloglines Subscriptions</title>
			<ownerName>opml2opml</ownerName>
		</head>
		<body>
			<xsl:apply-templates select="opml/body/outline"/>
		</body>
	</opml>
	</xsl:template>
	
	<xsl:template match="outline">
		<outline>
			<xsl:attribute name="title">
				<xsl:value-of select="concat(@title, ' (Bloglines)')"/>
			</xsl:attribute>
			<xsl:if test="@htmlUrl">
				<xsl:attribute name="htmlUrl">
					<xsl:value-of select="@htmlUrl"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:if test="@xmlUrl">
				<xsl:attribute name="xmlUrl">
					<xsl:value-of select="concat('http://rpc.bloglines.com/getitems?n=',$bloglines-read,'&amp;s=', ./@BloglinesSubId )"/>
				</xsl:attribute>
			</xsl:if>
			<xsl:apply-templates select="./*"/>
		</outline>
	</xsl:template>
</xsl:stylesheet>