make
Jun 10th, 2008, 05:21 AM
I created a podcast rss feed and with the help of xslt i tried to render the informatuion on browser. It works fine in all browsers except IE7 and safari.
Can any one please help me.
the xslt and rss xml that i used are below
xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlnssl="http://www.w3.org/1999/XSL/Transform"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<xsl:output method="html"/>
<xsl:variable name="title" select="/rss/channel/title"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="$title"/> - RSS Feed</title>
<style type="text/css">
</style>
</head>
<xsl:apply-templates select="rss/channel"/>
</html>
</xsl:template>
<xsl:template match="channel">
<body onload="document.getElementById('podurl').value=window.loc ation;">
<div id="main">
<div id="header">
<div class="topnavLeft">
<a href="/">
<img src="/imgs/global/logo-xx.jpg" width="64"
height="22" border="0" alt="example" id="logo"/>
</a>
<div class="topnavLnks"></div>
</div>
<div class="topnavRight">Powered by <a href="http://www.example.com">example</a></div>
</div>
<div id="content">
<img id="podLogo">
<xsl:attribute name="src">
<xsl:value-of select="./itunes:image/@href"/>
</xsl:attribute>
</img><h2><xsl:value-of select="title"/></h2>
<p id="description"><xsl:value-of select="./description"/></p>
<div id="preview">
<b>Preview </b>
<p>To preview the latest <a><xsl:attribute name="href"> <xsl:value-of select="./item/enclosure/@url"/>
</xsl:attribute>
download this file.</a></p></div>
<div id="instructions">
<b>How do I subscribe to this podcast?</b>
Feed URL:<br/>
<input type="text" size="45" id="podurl" value="" onclick="this.select();"/>
</div>
<h3>Contents:</h3><xsl:apply-templates select="item"/>
</div></div>
</body>
</xsl:template>
<xsl:template match="item">
<div class="item"><p>
<strong>
<a><xsl:attribute name="href"><xsl:value-of select="./enclosure/@url"/>
</xsl:attribute><xsl:value-of select="title"/></a>
</strong><br/><xsl:value-of select="itunes:summary"/><br/>
<em><xsl:value-of select="pubDate"/></em>
</p></div>
</xsl:template>
</xsl:stylesheet>
rss xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet title="XSL type="text/xsl" href="/styles/rss-stylesheet.xsl.xml"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<generator>example</generator>
<ttl>60</ttl>
<itunes:explicit>no</itunes:explicit>
<title>fortesting</title>
<link></link>
<description></description>
<language>en-us</language>
<copyright>(c)</copyright>
<itunes:subtitle></itunes:subtitle>
<itunes:author></itunes:author>
<itunes:owner>
<itunes:email></itunes:email>
</itunes:owner>
<itunes:summary></itunes:summary>
<image><url></url><title>for-example</title><link></link></image>
<itunes:image href=""/>
<item>
<title>NewJob</title>
<itunes:author>NewJob</itunes:author>
<itunes:subtitle>subtitle</itunes:subtitle>
<itunes:summary>summary </itunes:summary>
<itunes:duration>1:01</itunes:duration>
<itunes:keywords></itunes:keywords>
<itunes:explicit>no</itunes:explicit>
<guid isPermaLink="false"></guid>
<pubDate>Fri, 4 Apr 2008 00:00:00 IST</pubDate>
<enclosure url="http://example.com/audio/abcd.mp3" length="1734020" type="audio/x-mp3" />
</item>
</channel>
</rss>
Can any one please help me.
the xslt and rss xml that i used are below
xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlnssl="http://www.w3.org/1999/XSL/Transform"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<xsl:output method="html"/>
<xsl:variable name="title" select="/rss/channel/title"/>
<xsl:template match="/">
<html>
<head>
<title><xsl:value-of select="$title"/> - RSS Feed</title>
<style type="text/css">
</style>
</head>
<xsl:apply-templates select="rss/channel"/>
</html>
</xsl:template>
<xsl:template match="channel">
<body onload="document.getElementById('podurl').value=window.loc ation;">
<div id="main">
<div id="header">
<div class="topnavLeft">
<a href="/">
<img src="/imgs/global/logo-xx.jpg" width="64"
height="22" border="0" alt="example" id="logo"/>
</a>
<div class="topnavLnks"></div>
</div>
<div class="topnavRight">Powered by <a href="http://www.example.com">example</a></div>
</div>
<div id="content">
<img id="podLogo">
<xsl:attribute name="src">
<xsl:value-of select="./itunes:image/@href"/>
</xsl:attribute>
</img><h2><xsl:value-of select="title"/></h2>
<p id="description"><xsl:value-of select="./description"/></p>
<div id="preview">
<b>Preview </b>
<p>To preview the latest <a><xsl:attribute name="href"> <xsl:value-of select="./item/enclosure/@url"/>
</xsl:attribute>
download this file.</a></p></div>
<div id="instructions">
<b>How do I subscribe to this podcast?</b>
Feed URL:<br/>
<input type="text" size="45" id="podurl" value="" onclick="this.select();"/>
</div>
<h3>Contents:</h3><xsl:apply-templates select="item"/>
</div></div>
</body>
</xsl:template>
<xsl:template match="item">
<div class="item"><p>
<strong>
<a><xsl:attribute name="href"><xsl:value-of select="./enclosure/@url"/>
</xsl:attribute><xsl:value-of select="title"/></a>
</strong><br/><xsl:value-of select="itunes:summary"/><br/>
<em><xsl:value-of select="pubDate"/></em>
</p></div>
</xsl:template>
</xsl:stylesheet>
rss xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet title="XSL type="text/xsl" href="/styles/rss-stylesheet.xsl.xml"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<generator>example</generator>
<ttl>60</ttl>
<itunes:explicit>no</itunes:explicit>
<title>fortesting</title>
<link></link>
<description></description>
<language>en-us</language>
<copyright>(c)</copyright>
<itunes:subtitle></itunes:subtitle>
<itunes:author></itunes:author>
<itunes:owner>
<itunes:email></itunes:email>
</itunes:owner>
<itunes:summary></itunes:summary>
<image><url></url><title>for-example</title><link></link></image>
<itunes:image href=""/>
<item>
<title>NewJob</title>
<itunes:author>NewJob</itunes:author>
<itunes:subtitle>subtitle</itunes:subtitle>
<itunes:summary>summary </itunes:summary>
<itunes:duration>1:01</itunes:duration>
<itunes:keywords></itunes:keywords>
<itunes:explicit>no</itunes:explicit>
<guid isPermaLink="false"></guid>
<pubDate>Fri, 4 Apr 2008 00:00:00 IST</pubDate>
<enclosure url="http://example.com/audio/abcd.mp3" length="1734020" type="audio/x-mp3" />
</item>
</channel>
</rss>