2
XSL is a bit more complex, but seems to be very powerful. Both XSL and CSS will keep your RSS feed valid and won't change the way it's shown in a news aggregator AFAIK, while both can make RSS a little less ugly in browsers.
To use XSL, you'd have to include a line with
<?xml-stylesheet type="text/xsl" href="<{xoops_url}>/backend.xsl"?>
in your
system_rss.html template as above, making it the second line (you can also use CSS and XSL simultaneously).
Then you have to create a
backend.xsl file in your XOOPS root. Code can be something like
<?xml version="1.0" encoding="iso-8859-1"?>
<!--
FROM: rss2html.xsl BY: mlemos
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title>
<xsl:for-each select="rss/channel">
<xsl:value-of select="title"/><xsl:text> - </xsl:text><xsl:value-of select="description"/>
</xsl:for-each>
</title>
</head>
<body style="font-family: Verdana, Arial, Helvetica, sans-serif;">
<center>
<xsl:for-each select="rss/channel">
<div style="font-size: 30pt; font-weight: bold; color: #0000ff;"><xsl:value-of select="title"/></div>
<div style="font-size: 10pt;"><xsl:value-of select="link"/></div>
<div style="font-size: 18pt;"><xsl:value-of select="description"/></div>
<div style="font-size: 15pt; color: #0000ff;"><xsl:value-of select="lastBuildDate"/></div>
<div style="font-size: 18pt; font-weight: bold;"><xsl:value-of select="category"/></div>
</xsl:for-each>
</center>
<xsl:for-each select="rss/channel/item">
<p align="right">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
<xsl:text> - </xsl:text>
<small> <xsl:value-of select="pubDate"/></small></p>
</xsl:for-each>
<br /><br /><hr /><br /><br /><ul>
<xsl:for-each select="rss/channel/item">
<li style="border-style: dotted; border-width: thin; margin: 30px; padding: 20px;">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
<xsl:attribute name="style">display:block;font-weight:bold; color: #ff0000;</xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
<small>
<xsl:value-of select="pubDate"/></small>
<div style="text-align:justify;"><xsl:value-of select="description"/></div>
<div style="text-align:right; font-size: 10pt; color: #0000ff;"><xsl:value-of select="pubdate"/></div>
</li>
<hr />
</xsl:for-each>
</ul>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Example of result here.
Both examples are of static XML files, but if you want to see this working look at my site's
CSS styled backend.php.