gaim/www

Well most people seemed to like it...

2003-12-15, Mark Doliner
8d5203430211
Well most people seemed to like it...
I think the mdk links are wrong, but sf is down (?) and I don't
remember what they are actually called.
<?xml version="1.0"?>
<!--
XSLT transform for making a colour HTML file out of a devtodo XML database.
This was half derived from the XSLT transform from Daniel Patterson and
half from the transform by Mark Eichin.
It will output the todo database as colourised HTML, with done items struck
out.
If anybody has ANY enhancements to this file, PLEASE send them to me, as I
have very little clue WRT XSLT and this file is just a hack.
I generate HTML output with the following line (via libxslt):
xsltproc todo-html.xslt .todo > ../todo.html
-->
<xsl:stylesheet xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output xsl:method="html" xsl:indent="yes"/>
<xsl:strip-space xsl:elements="item bulletlist"/>
<!-- body -->
<xsl:template xsl:match="/">
<xsl:processing-instruction name="php">
require "base.inc.php";
start_html("Todo");
start_section("Gaim Todo");
?</xsl:processing-instruction>
<p align="center">
<b>Priorities:</b>
<font color="#FF0000">Very High</font>,
<font color="#660000">High</font>,
<font color="#000000">Medium</font>,
<font color="#000066">Low</font>,
<font color="#0000FF">Very Low</font>
</p>
<xsl:processing-instruction name="php">
end_section();
?</xsl:processing-instruction>
<xsl:for-each xsl:select="todo/note">
<xsl:processing-instruction name="php">
start_section("<xsl:value-of xsl:select="normalize-space(child::text())"/>");
?</xsl:processing-instruction>
<ul>
<xsl:for-each xsl:select="note">
<xsl:call-template xsl:name="noteItem"/>
</xsl:for-each>
</ul>
<xsl:processing-instruction name="php">
end_section();
?</xsl:processing-instruction>
</xsl:for-each>
<xsl:processing-instruction name="php">
end_html();
?</xsl:processing-instruction>
</xsl:template>
<xsl:template xsl:match="todo">
<xsl:param name="title"><xsl:apply-templates select="title"/></xsl:param>
<xsl:processing-instruction name="php">
start_section("<xsl:value-of select="$title"/>");
</xsl:processing-instruction>
<ul>
<xsl:for-each xsl:select="note">
<xsl:call-template xsl:name="noteItem"/>
</xsl:for-each>
</ul>
<xsl:processing-instruction name="php">
end_section();
</xsl:processing-instruction>
<xsl:for-each xsl:select="link">
<xsl:call-template xsl:name="noteItem"/>
</xsl:for-each>
</xsl:template>
<xsl:template xsl:match="title">
<xsl:value-of select="normalize-space(.)"/>
</xsl:template>
<xsl:template xsl:name="noteItem">
<xsl:if test="not(@done)">
<xsl:apply-templates xsl:select="."/>
</xsl:if>
</xsl:template>
<xsl:template xsl:match="note">
<li>
<xsl:choose>
<xsl:when test="count(./note|link) > 0">
<xsl:call-template xsl:name="baseNote">
<xsl:with-param name="append">:</xsl:with-param>
</xsl:call-template>
<ul>
<xsl:for-each xsl:select="note|link">
<xsl:call-template xsl:name="noteItem"/>
</xsl:for-each>
</ul>
</xsl:when>
<xsl:otherwise>
<xsl:call-template xsl:name="baseNote"/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>
<xsl:template xsl:match="link">
<xsl:apply-templates select="document(@filename)/todo"/>
</xsl:template>
<xsl:template xsl:name="baseNote">
<xsl:param name="append"/>
<xsl:variable xsl:name="priorityColor">
<xsl:choose>
<xsl:when xsl:test="@priority = 'veryhigh'">#FF0000</xsl:when>
<xsl:when xsl:test="@priority = 'high'">#660000</xsl:when>
<xsl:when xsl:test="@priority = 'medium'">#000000</xsl:when>
<xsl:when xsl:test="@priority = 'low'">#000066</xsl:when>
<xsl:when xsl:test="@priority = 'verylow'">#0000F0</xsl:when>
<xsl:otherwise>#000000</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Not done -->
<xsl:if xsl:test="not(@done)">
<font color="{$priorityColor}">
<xsl:value-of xsl:select="normalize-space(child::text())"/>
<xsl:value-of xsl:select="$append"/>
</font>
</xsl:if>
</xsl:template>
</xsl:stylesheet>