<?xml version="1.0"?>
<!-- opml2html.xsl 2002-11-12 jhan@acm.org Copyright 2002 Jay Han.  All rights reserved-->
<!-- a simple XSLT script to generate a html table from mySubscription.opml -->
<!--
Output html table should look like Radio's RSS Explorer except for the first
column of checkboxes:

Title | Description | RSS button

-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="html" indent="yes" standalone="yes" omit-xml-declaration="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" encoding="ISO-8859-1"/>
	<xsl:template match="opml">
		<html>
			<head>
				<title>
					<xsl:value-of select="head/ownerName"/>'s subcriptions on Radio Userland news aggregator


				</title>
			</head>
			<body>
				<p>
					<table border="1" cellspacing="1" cellpadding="5">
						<tr>
							<td valign="top">
								<b>Title</b>
							</td>
							<td valign="top">
								<b>Description</b>
							</td>
							<td valign="top">
								<b>RSS</b>
							</td>
						</tr>
						<xsl:apply-templates/>
					</table>
				</p> <!-- validator does not like this one. -->
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="*|@*|text()">
		<xsl:apply-templates select="*|@*|text()" />
	</xsl:template>
	
	<xsl:template match="body/outline">
		<!-- Some RSS feeds are scraped and contains 127.0.0.1 as xmlUrl.
		Skip these as they are not accessible to users. -->
		<xsl:if test="not(contains(@xmlUrl, '127.0.0.1'))">
			<tr>
				<td valign="top"> 

					<!-- title as href -->
					<a href="{@htmlUrl}">
						<xsl:value-of select="@title" disable-output-escaping="yes"/>
					</a>
				</td>
				<td  valign="top"> 

					<!-- description -->
					<!-- description can be empty hence empty and ugly cell.
					Just repeat the title if there is no description. -->
					<xsl:choose>
						<xsl:when test="string-length(@description) &gt; 0">
							<xsl:value-of select="@description" disable-output-escaping="yes"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="@title" disable-output-escaping="yes"/>
						</xsl:otherwise>
					</xsl:choose>
				</td>
				<td valign="top"> 

					<!-- RSS icon as href -->
					<a href="{@xmlUrl}" title="Click to view the current XML source text for the channel.">
						<img alt="" src="http://www.scripting.com/images/xml.gif" border="0" width="36" height="14"/>
					</a>
				</td>
			</tr>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>