Akregator Feed List -> HTML

02-09-2005

This is just a fast and dirty trick to display in a browser the RSS links inside the configuration file of Akregator. It will have very little use, unless you do not have Akregator in your system, and you would like to grab the links from the configuration file. (Kind of exporting the feeds to another program). The file has the extension .opml and it is just a XML file, but quite ofuscated.

First, let's create an XSL style sheet to transform the data. The file will be called akre2html.xsl. And this is the code:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"
	    charset="utf-8"	/>
<xsl:template match="/opml">
  <html>
  <body>
    <h2>Akregator links</h2> 
	<xsl:for-each select="//outline[@xmlUrl != '']">
		<a href="{@xmlUrl}"><xsl:value-of select="@title"/></a>
		<br/>
	</xsl:for-each> 	
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
	

Now just change the extension of the file from .opml to .xml (to make things easier for the web browsers). But before, add the following directive at the start of the .opml file (to tell the web browser this file should be displayed with the style sheet we created):

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="akre2html.xsl"?>
(...)
	

Now just open the .xml file with your favourite web browser. Seems that nearly all modern browsers support XSLT, so they would display the document as a simple web page. (I have tested it, and works with Firefox and Safari).


comment feed - top


·La Rabadilla· ·Laconada· ·iRamos· ·O Vello Corvo· ·Palabros·
counter [CSS 2 Valid!] [XHTML 1.0 Valid!] [Made with Ant] [Get Firefox] RSS 1.0RSS 1.0 Atom 1.0RSS 1.0