1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <xsl:stylesheet version = '
1.0'
3 xmlns:xsl='http://www.w3.org/
1999/XSL/Transform'
>
5 <!-- colour.xsl DJCM 2004 -->
7 <xsl:output method=
"html" encoding=
"UTF-8" indent=
"yes" omit-xml-declaration=
"yes"
8 doctype-public=
"-//W3C//DTD HTML 4.01//EN"
9 doctype-system=
"http://www.w3.org/TR/html4/strict.dtd" />
12 <xsl:template match=
"colours">
15 <title>Dasher Colour Schemes
</title>
16 <!-- Uncomment the following line if your xslt processor doesn't add it.
17 xsltproc from the Gnome project (and available for Windows) does. -->
18 <!-- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -->
19 <link rel=
"home" title=
"Home" href=
"http://www.inference.phy.cam.ac.uk/dasher/"/>
20 <link rel=
"contact" title=
"Contact" href=
"http://www.metafaq.com/faq/dasher/"/>
21 <style type=
"text/css">
22 .content {font-family : 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;}
23 .content h1 {border-bottom :
2px solid #
4686c2; margin-bottom :
1em;}
24 .content h2 {margin-top :
0;}
27 background-color : #
4686c2;
29 border:
0 solid #
4686c2;
37 <h1><a><xsl:attribute name=
"href">http://www.inference.phy.cam.ac.uk/dasher/
</xsl:attribute>Dasher
</a>
38 <a><xsl:attribute name=
"href">http://www.inference.phy.cam.ac.uk/dasher/download/alphabets/
</xsl:attribute>Alphabets
</a></h1>
39 <xsl:apply-templates select=
"//palette"/>
42 <div style=
"text-align:right"><em>This page automagically generated by
43 <a><xsl:attribute name=
"href">http://www.inference.phy.cam.ac.uk/dasher/download/alphabets/colour.xsl
</xsl:attribute>
51 <xsl:variable name=
"hex" >0123456789ABCDEF
</xsl:variable>
52 <xsl:variable name=
"col" >0</xsl:variable>
54 <xsl:template match=
"palette">
55 <h2><xsl:value-of select=
"@name"/></h2>
56 <table bgcolor=
"#888888"><tr><td>
57 <table bgcolor=
"#bbbbbb">
58 <xsl:for-each select=
"colour"> <tr bgcolor=
"#ffffee">
59 <td><xsl:number value=
"position()-1"></xsl:number> </td>
60 <td><xsl:value-of select=
"@r"/>
62 <td><xsl:value-of select=
"@g"/></td>
63 <td><xsl:value-of select=
"@b"/></td>
64 <td> <xsl:call-template name=
"hexify">
65 <xsl:with-param name=
"str" select=
"@r"/>
67 <xsl:call-template name=
"hexify">
68 <xsl:with-param name=
"str" select=
"@g"/>
70 <xsl:call-template name=
"hexify">
71 <xsl:with-param name=
"str" select=
"@b"/>
75 <xsl:attribute name=
"bgcolor">
76 #
<xsl:call-template name=
"hexify">
77 <xsl:with-param name=
"str" select=
"@r"/>
79 <xsl:call-template name=
"hexify">
80 <xsl:with-param name=
"str" select=
"@g"/>
82 <xsl:call-template name=
"hexify">
83 <xsl:with-param name=
"str" select=
"@b"/>
86 <xsl:call-template name=
"hexify">
87 <xsl:with-param name=
"str" select=
"@r"/>
89 <xsl:call-template name=
"hexify">
90 <xsl:with-param name=
"str" select=
"@g"/>
92 <xsl:call-template name=
"hexify">
93 <xsl:with-param name=
"str" select=
"@b"/>
98 </table></td></tr></table>
103 <xsl:template name=
"hexify">
104 <xsl:param name=
"str"/>
105 <xsl:variable name=
"hex-digit1" select=
"substring($hex,floor($str div 16) + 1,1)"/>
106 <xsl:variable name=
"hex-digit2" select=
"substring($hex,$str mod 16 + 1,1)"/>
107 <xsl:value-of select=
"concat($hex-digit1,$hex-digit2)"/>