Hello,
I've been trying to format the google rss feed in a way that the top news item would have the associated image, then 4-5 more news items are listed, but that's all. A lot like the news is shown on the right hand side of
Using a xsl document, I can list every detail in the feed, or I can list just the titles, but can't seem to get it how I want it. I've used just simple xsl stylesheets found on the net due to my lack of knowledge.
Can anyone point me in the right direction, is this a simple thing to do?
The rss feed I'm trying to format is
And here is the xsl sheet so far
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="xml" encoding="iso-8859-1" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<!--SETS UP THE TABLE PROPERTIES-->
<table border="0" cellspacing="3">
<!--SETS UP THE TITLE CELL PROPERTIES-->
<tr><td valign="top" align="center" bgcolor="#EFEFEF" >
<!--SETS UP THE TITLE LINK-->
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='channel']/*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='title']" disable-output-escaping="yes"/>
</a>
</td></tr>
<!--SETS UP THE CONTENT AND TABLE CELLS FOR EACH NEWS ITEM-->
<xsl:for-each select="//*[local-name()='item']">
<tr><td valign="top" bgcolor="#E7F7FF">
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']" disable-output-escaping="yes"/>
</a><br></br>
<xsl:value-of select="*[local-name()='description']" disable-output-escaping="yes"/>
<br></br>
</td></tr>
</xsl:for-each>
<!--CLOSES THE TABLE-->
</table>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Thanks
I've been trying to format the google rss feed in a way that the top news item would have the associated image, then 4-5 more news items are listed, but that's all. A lot like the news is shown on the right hand side of
Using a xsl document, I can list every detail in the feed, or I can list just the titles, but can't seem to get it how I want it. I've used just simple xsl stylesheets found on the net due to my lack of knowledge.
Can anyone point me in the right direction, is this a simple thing to do?
The rss feed I'm trying to format is
And here is the xsl sheet so far
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xslutput method="xml" encoding="iso-8859-1" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<!--SETS UP THE TABLE PROPERTIES-->
<table border="0" cellspacing="3">
<!--SETS UP THE TITLE CELL PROPERTIES-->
<tr><td valign="top" align="center" bgcolor="#EFEFEF" >
<!--SETS UP THE TITLE LINK-->
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='channel']/*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='channel']/*[local-name()='title']" disable-output-escaping="yes"/>
</a>
</td></tr>
<!--SETS UP THE CONTENT AND TABLE CELLS FOR EACH NEWS ITEM-->
<xsl:for-each select="//*[local-name()='item']">
<tr><td valign="top" bgcolor="#E7F7FF">
<a>
<xsl:attribute name="href">
<xsl:value-of select="*[local-name()='link']"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:text>top</xsl:text>
</xsl:attribute>
<xsl:value-of select="*[local-name()='title']" disable-output-escaping="yes"/>
</a><br></br>
<xsl:value-of select="*[local-name()='description']" disable-output-escaping="yes"/>
<br></br>
</td></tr>
</xsl:for-each>
<!--CLOSES THE TABLE-->
</table>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Thanks