<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />

<xsl:template match="rss/channel">
	<html>
	<head>
	<title>Sample XSL Transformation</title>
	</head>
	<body>
	<h3>sample xsl transformation</h3>

	<xsl:for-each select="item">
		<a>
			<xsl:attribute name="href">
				<xsl:value-of select="link" />
			</xsl:attribute>
			<xsl:attribute name="target">
				<xsl:text>new</xsl:text>
			</xsl:attribute>
			<xsl:value-of disable-output-escaping="yes" select="title" />
		</a><br />
		<table width="90%"><tr><td>
<xsl:call-template name="removeTag">
<xsl:with-param name="input" select="description" />
<xsl:with-param name="tag" select="'&lt;img'"/>
</xsl:call-template>
</td></tr></table>
<![CDATA[
]]>
	</xsl:for-each>
	
	</body>
	</html>

</xsl:template>



<xsl:template name="removeTag">
  <xsl:param name="input"/>
  <xsl:param name="tag"/>
  <xsl:choose>
    <xsl:when test="contains($input,$tag)">
      <xsl:value-of select="substring-before($input,$tag)"/>
      <xsl:call-template name="removeTag">
        <xsl:with-param name="input" select="substring-after(substring-after($input,$tag),'/>')"/>
        <xsl:with-param name="tag" select="$tag"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of disable-output-escaping="yes" select="$input"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>
