| 1 |
<?xml version="1.0"?> |
| 2 |
<xsl:stylesheet version="1.0" |
| 3 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
| 4 |
|
| 5 |
<xsl:output |
| 6 |
method="html" |
| 7 |
indent="yes" |
| 8 |
doctype-public="-//W3C//DTD HTML 4.01//EN" |
| 9 |
doctype-system="http://www.w3.org/TR/html4/strict.dtd" |
| 10 |
encoding="ISO-8859-1" /> |
| 11 |
|
| 12 |
<xsl:param name="filename"/> |
| 13 |
|
| 14 |
<xsl:template match="node()|@*"> |
| 15 |
<xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy> |
| 16 |
</xsl:template> |
| 17 |
|
| 18 |
<xsl:template match="dlink"> |
| 19 |
<a href="{@href}"><xsl:value-of select="@href"/></a> |
| 20 |
</xsl:template> |
| 21 |
|
| 22 |
<xsl:template match="dlink-full"> |
| 23 |
<a href="{@href}"><xsl:value-of select="@href"/></a> |
| 24 |
</xsl:template> |
| 25 |
|
| 26 |
<xsl:template match="page"> |
| 27 |
<html> |
| 28 |
<head> |
| 29 |
<title>ClanLib - <xsl:value-of select="@title" /></title> |
| 30 |
<link rel="stylesheet" type="text/css" href="default.css" /> |
| 31 |
<link rel="icon" href="http://clanlib.org/gfx/favicon.png" type="image/png" /> |
| 32 |
<!--<link REL="help" HREF="faq.html" title="FAQ"/> |
| 33 |
<link REL="section" HREF="faq.html" title="Intro"/> |
| 34 |
<link REL="shortcut icon" href="/favicon.ico" type="image/x-icon" />--> |
| 35 |
</head> |
| 36 |
<body> |
| 37 |
|
| 38 |
<div style="border-style: solid; border-width:thin; border-color: black;"> |
| 39 |
<div style="background-color: white; color: black; padding: .3em 1em .3em 1em; border-bottom-style: dotted; border-bottom-width: 2px;"> |
| 40 |
|
| 41 |
<table cellspacing="0" cellpadding="0" border="0" width="100%"> |
| 42 |
<tr> |
| 43 |
<td align="center"> |
| 44 |
<h1><a href="http://www.clanlib.org"><img style="border-style: none; padding-right: 130px;" src="http://clanlib.org/gfx/clanlib.png" alt="ClanLib" /></a></h1> |
| 45 |
</td> |
| 46 |
</tr> |
| 47 |
</table> |
| 48 |
|
| 49 |
<xsl:apply-templates select="document('menu.xml')" /> |
| 50 |
|
| 51 |
</div> |
| 52 |
<div style="background-color: white; padding: 1em 3em 1em 3em;"> |
| 53 |
<xsl:apply-templates /> |
| 54 |
|
| 55 |
<div id="footer"> |
| 56 |
Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>. |
| 57 |
</div> |
| 58 |
</div> |
| 59 |
</div> |
| 60 |
</body> |
| 61 |
</html> |
| 62 |
</xsl:template> |
| 63 |
|
| 64 |
<xsl:template match="menu"> |
| 65 |
<div class="menu"> |
| 66 |
<xsl:apply-templates /> |
| 67 |
</div> |
| 68 |
</xsl:template> |
| 69 |
|
| 70 |
|
| 71 |
<xsl:template match="menu/item"> |
| 72 |
<xsl:choose> |
| 73 |
<xsl:when test="concat($filename, '.html')=@file"> |
| 74 |
<a class="active" href="{@file}"><xsl:apply-templates /></a> |
| 75 |
</xsl:when> |
| 76 |
<xsl:otherwise> |
| 77 |
<a href="{@file}"><xsl:apply-templates /></a> |
| 78 |
</xsl:otherwise> |
| 79 |
</xsl:choose> |
| 80 |
</xsl:template> |
| 81 |
|
| 82 |
<xsl:template match="typewriter"> |
| 83 |
<div style="font-family: Sans-Serif; background-color: #dddddd; padding: 1em; margin: 1em;"> |
| 84 |
<xsl:apply-templates /> |
| 85 |
</div> |
| 86 |
</xsl:template> |
| 87 |
|
| 88 |
<xsl:template match="section"> |
| 89 |
<div style="border-bottom-style: dotted; border-bottom-width: 1px; margin-bottom: 1em;"> |
| 90 |
<h2><xsl:value-of select="@title" /></h2> |
| 91 |
</div> |
| 92 |
<xsl:apply-templates /> |
| 93 |
<br /> |
| 94 |
</xsl:template> |
| 95 |
|
| 96 |
<xsl:template match="subsection"> |
| 97 |
<div style="border-bottom-style: dotted; border-bottom-width: 1px;"> |
| 98 |
<h3><xsl:value-of select="@title" /></h3> |
| 99 |
</div> |
| 100 |
<xsl:apply-templates /> |
| 101 |
<br /> |
| 102 |
</xsl:template> |
| 103 |
|
| 104 |
<xsl:template match="subsubsection"> |
| 105 |
<div style="border-bottom-style: dotted; border-bottom-width: 1px;"> |
| 106 |
<h4><xsl:value-of select="@title" /></h4> |
| 107 |
</div> |
| 108 |
<xsl:apply-templates /> |
| 109 |
<br /> |
| 110 |
</xsl:template> |
| 111 |
|
| 112 |
<xsl:template match="screenshots"> |
| 113 |
<table summary="" width="100%" border="0" cellpadding="0" cellspacing="0"> |
| 114 |
|
| 115 |
<tr> |
| 116 |
<td align="center"> |
| 117 |
<xsl:apply-templates select="item[1]"/> |
| 118 |
</td> |
| 119 |
<td align="center"> |
| 120 |
<xsl:apply-templates select="item[2]"/> |
| 121 |
</td> |
| 122 |
<td align="center"> |
| 123 |
<xsl:apply-templates select="item[3]"/> |
| 124 |
</td> |
| 125 |
</tr> |
| 126 |
|
| 127 |
<xsl:if test="count(item)>3"> |
| 128 |
<tr> |
| 129 |
<td align="center"> |
| 130 |
<xsl:apply-templates select="item[4]"/> |
| 131 |
</td> |
| 132 |
<td align="center"> |
| 133 |
<xsl:apply-templates select="item[5]"/> |
| 134 |
</td> |
| 135 |
<td align="center"> |
| 136 |
<xsl:apply-templates select="item[6]"/> |
| 137 |
</td> |
| 138 |
</tr> |
| 139 |
</xsl:if> |
| 140 |
|
| 141 |
|
| 142 |
<xsl:if test="count(item)>6"> |
| 143 |
<tr> |
| 144 |
<td align="center"> |
| 145 |
<xsl:apply-templates select="item[7]"/> |
| 146 |
</td> |
| 147 |
<td align="center"> |
| 148 |
<xsl:apply-templates select="item[8]"/> |
| 149 |
</td> |
| 150 |
<td align="center"> |
| 151 |
<xsl:apply-templates select="item[9]"/> |
| 152 |
</td> |
| 153 |
</tr> |
| 154 |
</xsl:if> |
| 155 |
|
| 156 |
</table> |
| 157 |
</xsl:template> |
| 158 |
|
| 159 |
<xsl:template match="screenshots/item"> |
| 160 |
<a href="http://clanlib.org/gfx/{@file}.jpg"><img class="screenshot" alt="{@file}" src="http://clanlib.org/gfx/{@file}_small.jpg" title="{.}"/></a> |
| 161 |
</xsl:template> |
| 162 |
|
| 163 |
<xsl:template match="screenshot-menu"> |
| 164 |
<p style="text-align: center;"> |
| 165 |
[ |
| 166 |
<a href="screenshots.html">0.1</a> |
| 167 |
| |
| 168 |
<a href="screenshots-0.0.html">0.0</a> |
| 169 |
] |
| 170 |
</p> |
| 171 |
</xsl:template> |
| 172 |
|
| 173 |
<xsl:template match="section-toc"> |
| 174 |
<ul> |
| 175 |
<xsl:for-each select="section"> |
| 176 |
<li><a href="#section{generate-id(.)}"> |
| 177 |
<xsl:apply-templates/></a></li> |
| 178 |
</xsl:for-each> |
| 179 |
</ul> |
| 180 |
<hr/> |
| 181 |
<xsl:apply-templates/> |
| 182 |
</xsl:template> |
| 183 |
|
| 184 |
<xsl:template match="faq-list"> |
| 185 |
<ul> |
| 186 |
<xsl:for-each select="faq/question"> |
| 187 |
<li><a href="#faq{generate-id(.)}"> |
| 188 |
<xsl:apply-templates/></a></li> |
| 189 |
</xsl:for-each> |
| 190 |
</ul> |
| 191 |
<hr/> |
| 192 |
<xsl:apply-templates/> |
| 193 |
</xsl:template> |
| 194 |
|
| 195 |
<xsl:template match="faq"> |
| 196 |
<p></p> |
| 197 |
<table width="100%" class="question"> |
| 198 |
<colgroup width="60%" /> |
| 199 |
<tr><td valign="top"> |
| 200 |
<div id="faq{generate-id(question)}"> |
| 201 |
<xsl:apply-templates select="question/node()"/> |
| 202 |
</div> |
| 203 |
</td> |
| 204 |
|
| 205 |
|
| 206 |
<td align="right" valign="top"> |
| 207 |
<small>Last update:<xsl:value-of select="@date"/></small> |
| 208 |
[<small><a href="#faqtoc">Up</a></small>] |
| 209 |
</td> |
| 210 |
</tr> |
| 211 |
</table> |
| 212 |
|
| 213 |
<div class="answer"><xsl:apply-templates select="answer/node()"/></div> |
| 214 |
</xsl:template> |
| 215 |
|
| 216 |
<xsl:template match="news"> |
| 217 |
<xsl:apply-templates /> |
| 218 |
</xsl:template> |
| 219 |
|
| 220 |
<xsl:template match="news/item"> |
| 221 |
<div style="margin-bottom: 2em; border-width: 1px; border-style: solid;"> |
| 222 |
<div class="newsbox"> |
| 223 |
<xsl:value-of select="@date"/>: |
| 224 |
<xsl:value-of select="title" /> |
| 225 |
</div> |
| 226 |
<div style="padding-left: 1em; padding-right: 1em;"> |
| 227 |
<xsl:apply-templates select="*[position()>1]" /> |
| 228 |
</div> |
| 229 |
</div> |
| 230 |
</xsl:template> |
| 231 |
|
| 232 |
<xsl:template match="games"> |
| 233 |
<table align="center" width="70%"> |
| 234 |
<xsl:apply-templates select="game"> |
| 235 |
<xsl:sort select="name" /> |
| 236 |
</xsl:apply-templates> |
| 237 |
</table> |
| 238 |
</xsl:template> |
| 239 |
|
| 240 |
<xsl:template match="game"> |
| 241 |
<tr> |
| 242 |
<td valign="middle"> |
| 243 |
<br /> |
| 244 |
<xsl:choose> |
| 245 |
<xsl:when test="image != ''"> |
| 246 |
<a href="http://clanlib.org/gfx/games/{image}.jpg"><img src="http://clanlib.org/gfx/games/{image}_small.jpg" alt="{name} Screenshots" /></a> |
| 247 |
</xsl:when> |
| 248 |
<xsl:otherwise> |
| 249 |
<img src="http://clanlib.org/gfx/noscreenshot.png" alt="" /> |
| 250 |
</xsl:otherwise> |
| 251 |
</xsl:choose> |
| 252 |
<br /> |
| 253 |
</td> |
| 254 |
|
| 255 |
<td> |
| 256 |
<strong><xsl:value-of select="name" /> |
| 257 |
<xsl:if test="url != ''"> |
| 258 |
- <a href="{url}"><xsl:value-of select="url" /></a> |
| 259 |
</xsl:if> |
| 260 |
</strong><br /> |
| 261 |
<xsl:value-of select="description" /> |
| 262 |
</td> |
| 263 |
</tr> |
| 264 |
</xsl:template> |
| 265 |
|
| 266 |
<xsl:template match="tm"> |
| 267 |
<sup>tm</sup> |
| 268 |
</xsl:template> |
| 269 |
|
| 270 |
<xsl:template match="thumbnail-link"> |
| 271 |
<a href="{@href}"><img |
| 272 |
class="screenshot" |
| 273 |
src="{substring-before(@href, '.jpg')}_small.jpg" |
| 274 |
alt="{substring-before(@href, '.jpg')}_small.jpg"/></a> |
| 275 |
</xsl:template> |
| 276 |
</xsl:stylesheet> |