[darcs-users] generating darcs RSS feeds with XSLT

Mark Stosberg mark at summersault.com
Sun Jan 9 03:09:25 UTC 2005


For those who want RSS feeds of darcs changelogs without install the CGI
suite, here's another alternative to darcs2rss.

As someone suggested here before: Given the right the XML stylesheet,
you don't need a special script involved at all. Such a (nearly) working  
script is distributed with darcs now, located at:

 cgi/xslt/rss.xslt 

I only had to add one line to the file to get it to work, a variable 
declaration that looks like this:

 <xsl:variable name="cgi-url">http://www.example.com/cgi-bin/darcs.cgi</xsl:variable>

With that added, I could now generate my RSS feed like this:

 darcs changes --xml --last 10 | xsltproc rss.xslt - 

Although I hadn't needed it before, I found that 'xsltproc' was already
installed on my system, I assume from some other XML project that required it.

It's interesting to compare this alternative to 'darcs2rss'. First,
notice that you can directly manipulate flags to 'changes' to alter the
output. There is no new syntax to learn for "--last".  

If you need to make changes to the output, editing the 'rss.xslt'
file is not scary. It looks like HTML and it will fairly clear I think
how your changes might affect the RSS file-- because it's a template for 
the generated file. 

For more information on XSLT, this might be interesting:
http://www.xml.com/pub/a/2000/08/holman/

    Mark

-- 
http://mark.stosberg.com/ 





More information about the darcs-users mailing list