1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 <!-- This file is part of Shapes. -->
5 <!-- Shapes is free software: you can redistribute it and/or modify -->
6 <!-- it under the terms of the GNU General Public License as published by -->
7 <!-- the Free Software Foundation, either version 3 of the License, or -->
8 <!-- any later version. -->
10 <!-- Shapes is distributed in the hope that it will be useful, -->
11 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
12 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
13 <!-- GNU General Public License for more details. -->
15 <!-- You should have received a copy of the GNU General Public License -->
16 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
18 <!-- Copyright 2008, 2009, 2010, 2013, 2014 Henrik Tidefelt -->
22 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
23 xmlns=
"http://www.w3.org/1999/xhtml"
26 <xsl:template match=
"str-PDF"><span class=
"medium-caps">pdf
</span></xsl:template>
27 <xsl:template match=
"str-HTML"><span class=
"medium-caps">html
</span></xsl:template>
28 <xsl:template match=
"str-XML"><span class=
"medium-caps">xml
</span></xsl:template>
29 <xsl:template match=
"str-SVG"><span class=
"medium-caps">svg
</span></xsl:template>
30 <xsl:template match=
"str-PNG"><span class=
"medium-caps">png
</span></xsl:template>
31 <xsl:template match=
"str-JPEG"><span class=
"medium-caps">jpeg
</span></xsl:template>
32 <xsl:template match=
"str-DAG"><span class=
"medium-caps">dag
</span></xsl:template>
33 <xsl:template match=
"str-PostScript">PostScript
</xsl:template>
34 <xsl:template match=
"str-Shapes">Shapes
</xsl:template>
35 <xsl:template match=
"str-shapes-mode"><em>shapes-mode
</em></xsl:template>
36 <xsl:template match=
"str-TeX"><span class=
"tex">T
<sub>e
</sub>X
</span></xsl:template>
37 <xsl:template match=
"str-LaTeX"><span class=
"latex">L
<sup>a
</sup>T
<sub>e
</sub>X
</span></xsl:template>
38 <xsl:template match=
"str-pdfLaTeX"><span class=
"latex">pdfL
<sup>a
</sup>T
<sub>e
</sub>X
</span></xsl:template>
39 <xsl:template match=
"str-MetaPost">MetaPost
</xsl:template>
40 <xsl:template match=
"str-C-plus-plus"><span class=
"medium-caps">c
</span>++
</xsl:template>
41 <xsl:template match=
"str-UTF-8"><span class=
"medium-caps">utf
</span>-
8</xsl:template>
42 <xsl:template match=
"str-2D">2<span class=
"medium-caps"><sup>d
</sup></span></xsl:template>
43 <xsl:template match=
"str-3D">3<span class=
"medium-caps"><sup>d
</sup></span></xsl:template>
45 <xsl:template name=
"str-Google" match=
"str-Google"><span class=
"Google"><span class=
"blue">G
</span><span class=
"red">o
</span><span class=
"yellow">o
</span><span class=
"blue">g
</span><span class=
"green">l
</span><span class=
"red">e
</span><span class=
"black">™
</span></span></xsl:template>
47 <xsl:template match=
"abbr-etc">&c
</xsl:template>
49 <xsl:template match=
"char-cdot">*
</xsl:template>
50 <xsl:template match=
"char-bullet">•
</xsl:template>
51 <xsl:template match=
"char-str-open">`
</xsl:template>
52 <xsl:template match=
"char-str-close">´
</xsl:template>
54 <xsl:template match=
"const-false"><span class=
"rm">false
</span></xsl:template>
55 <xsl:template match=
"const-true"><span class=
"rm">true
</span></xsl:template>
57 <xsl:template match=
"x-hat"><b>x
</b></xsl:template>
58 <xsl:template match=
"y-hat"><b>y
</b></xsl:template>
59 <xsl:template match=
"z-hat"><b>z
</b></xsl:template>
61 <xsl:template match=
"physical"><span class=
"nowrap"><xsl:apply-templates select=
"scalar" /><span class=
"xx-small"> </span><xsl:apply-templates select=
"unit" /></span></xsl:template>
62 <xsl:template match=
"sci-fmt[@mantissa,@exp]"><span class=
"nowrap"><xsl:value-of select=
"@mantissa" /><span class=
"small-caps">e
</span><xsl:value-of select=
"@exp" /></span></xsl:template>
63 <xsl:template match=
"quote">“
<xsl:apply-templates />”
</xsl:template>
65 <xsl:template match=
"p[not(@class)]">
66 <div class=
"p"><xsl:apply-templates/></div>
68 <xsl:template match=
"p[@class='center']">
69 <div class=
"p" style=
"text-align:center;"><xsl:apply-templates/></div>
71 <xsl:template match=
"p[@class='todo']">
72 <div class=
"p todo"><xsl:apply-templates/></div>
75 <xsl:template match=
"ol">
76 <ol><xsl:apply-templates/></ol>
78 <xsl:template match=
"ol/li">
79 <li><xsl:apply-templates/></li>
82 <xsl:template match=
"ul">
83 <ul><xsl:apply-templates/></ul>
85 <xsl:template match=
"ul/li">
86 <li><xsl:apply-templates/></li>
89 <xsl:template match=
"pre">
91 <xsl:apply-templates/>
94 <xsl:template match=
"pre[@class]">
95 <xsl:element name=
"pre">
96 <xsl:attribute name=
"class"><xsl:value-of select=
"@class" /></xsl:attribute>
97 <xsl:apply-templates/>
101 <xsl:template match=
"note">
103 <tr><td><xsl:apply-templates/></td></tr>
107 <xsl:template match=
"see-also">
110 <xsl:for-each select=
"*">
111 <xsl:text> </xsl:text>
112 <span class=
"horizontal-item">
113 <xsl:apply-templates select=
"."/>
119 <xsl:template name=
"under-development-banner">
120 <div class=
"upper-right-banner">
121 <div class=
"banner-content">Under development
</div>
125 <xsl:template name=
"version-header">
126 <div class=
"version-header"><xsl:text>For version
</xsl:text>
128 <xsl:when test=
"/book/shapes-version"><xsl:value-of select=
"/book/shapes-version/@number" /></xsl:when>
129 <xsl:when test=
"/man/manhead/shapes-version"><xsl:value-of select=
"/man/manhead/shapes-version/@number" /></xsl:when>
131 <xsl:text>.
</xsl:text>
135 <xsl:template name=
"head-navigation" >
136 <xsl:call-template name=
"version-header" />
138 <xsl:element name=
"a"><xsl:attribute name=
"href"><xsl:value-of select=
"/book/base/@href" />index.html
</xsl:attribute><xsl:text>To top.
</xsl:text></xsl:element>
139 <xsl:if test=
"/book/up-link">
140 <xsl:text> Up:
</xsl:text><xsl:apply-templates select=
"/book/up-link" />
145 <xsl:template name=
"part-to-href">
146 <xsl:param name=
"name" />
147 <xsl:value-of select=
"/book/base/@href" /><xsl:choose>
148 <xsl:when test=
"$name='structure'">structure.html
</xsl:when>
149 <xsl:when test=
"$name='syntax'">syntax.html
</xsl:when>
150 <xsl:when test=
"$name='bindings'">bindings.html
</xsl:when>
151 <xsl:when test=
"$name='states'">states.html
</xsl:when>
152 <xsl:when test=
"$name='dynamic'">dynamic.html
</xsl:when>
153 <xsl:when test=
"$name='types'">types.html
</xsl:when>
154 <xsl:when test=
"$name='state-types'">state-types.html
</xsl:when>
155 <xsl:when test=
"$name='algo-tol'">algo-tol.html
</xsl:when>
156 <xsl:when test=
"$name='man'">man.html
</xsl:when>
157 <xsl:when test=
"$name='tutorial'">tutorial.html
</xsl:when>
158 <xsl:when test=
"$name='guides'">guides.html
</xsl:when>
159 <xsl:when test=
"$name='extensions'">extensions/index.html
</xsl:when>
160 <xsl:when test=
"$name='install'">install.html
</xsl:when>
161 <xsl:when test=
"$name='interactive'">interactive.html
</xsl:when>
162 <xsl:when test=
"$name='edit'">edit.html
</xsl:when>
163 <xsl:when test=
"$name='namespace-index'">namespace-index.html
</xsl:when>
166 <xsl:template name=
"extension-to-href">
167 <xsl:param name=
"namespace" />
168 <xsl:param name=
"name" />
170 <xsl:when test=
"$namespace">
171 <xsl:value-of select=
"/book/base/@href" /><xsl:text>extensions/
</xsl:text><xsl:value-of select=
"replace(replace($namespace, '^\.\.', ''), '\.\.', '-')" />-
<xsl:value-of select=
"$name" /><xsl:text>.html
</xsl:text>
174 <xsl:value-of select=
"/book/base/@href" /><xsl:text>extensions/
</xsl:text><xsl:value-of select=
"$name" /><xsl:text>.html
</xsl:text>
178 <xsl:template name=
"guide-to-href">
179 <xsl:param name=
"name" />
180 <xsl:value-of select=
"/book/base/@href" /><xsl:text>guides/
</xsl:text><xsl:value-of select=
"$name" /><xsl:text>.html
</xsl:text>
182 <xsl:template name=
"id-to-anchor-name">
183 <xsl:param name=
"id" />
184 <xsl:value-of select=
"replace(replace(concat('secid:', $id), '-', '--'), '/', '-.')" />
186 <xsl:template name=
"env-var-to-anchor-name">
187 <xsl:param name=
"id" />
188 <xsl:value-of select=
"replace(replace(concat('env:', $id), '-', '--'), '/', '-.')" />
191 <xsl:template match=
"env-var[@name]">
192 <xsl:element name=
"a">
193 <xsl:attribute name=
"class">discrete
</xsl:attribute>
194 <xsl:attribute name=
"href">
195 <xsl:call-template name=
"part-to-href">
196 <xsl:with-param name=
"name">man
</xsl:with-param>
197 </xsl:call-template>#
<xsl:call-template name=
"env-var-to-anchor-name">
198 <xsl:with-param name=
"id"><xsl:value-of select=
"@name" /></xsl:with-param>
201 <xsl:value-of select=
"@name" />
205 <xsl:template match=
"part-href[@name]">
206 <xsl:call-template name=
"part-to-href">
207 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
210 <xsl:template match=
"extension-href[@name]">
211 <xsl:call-template name=
"extension-to-href">
212 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
215 <xsl:template name=
"name-to-linked-extension">
216 <xsl:param name=
"current-namespace" />
217 <xsl:param name=
"namespace" />
218 <xsl:param name=
"name" />
219 <xsl:variable name=
"ns">
221 <xsl:when test=
"starts-with($namespace, '..')">
222 <xsl:value-of select=
"$namespace" />
224 <xsl:when test=
"$namespace = ''">
225 <xsl:value-of select=
"$current-namespace" />
227 <xsl:when test=
"$current-namespace = '..'">
228 <xsl:value-of select=
"concat('..', $namespace)" />
231 <xsl:value-of select=
"concat($current-namespace, '..', $namespace)" />
235 <xsl:element name=
"a">
236 <xsl:attribute name=
"class">discrete
</xsl:attribute>
237 <xsl:attribute name=
"href">
238 <xsl:call-template name=
"extension-to-href">
239 <xsl:with-param name=
"namespace"><xsl:value-of select=
"$ns" /></xsl:with-param>
240 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
244 <xsl:when test=
"$ns = $current-namespace">
245 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
247 <xsl:when test=
"$current-namespace != ''">
248 <xsl:variable name=
"prefix">^
<xsl:value-of select=
"$current-namespace" />\.\.
</xsl:variable>
249 <xsl:call-template name=
"format-namespace-name">
250 <xsl:with-param name=
"name"><xsl:value-of select=
"replace($ns, $prefix, '')" /></xsl:with-param>
252 <xsl:text> /
</xsl:text>
253 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
256 <xsl:call-template name=
"format-namespace-name">
257 <xsl:with-param name=
"name"><xsl:value-of select=
"$ns" /></xsl:with-param>
259 <xsl:text> /
</xsl:text>
260 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
265 <xsl:template match=
"extension[@path]">
266 <xsl:variable name=
"namespace"><xsl:value-of select=
"replace(@path, '/.*$', '')" /></xsl:variable>
267 <xsl:variable name=
"name"><xsl:value-of select=
"replace(@path, '^.*/', '')" /></xsl:variable>
268 <xsl:call-template name=
"name-to-linked-extension">
269 <xsl:with-param name=
"namespace"><xsl:value-of select=
"$namespace" /></xsl:with-param>
270 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
273 <xsl:template match=
"/book[namespace]//extension[@name]">
274 <xsl:call-template name=
"name-to-linked-extension">
275 <xsl:with-param name=
"current-namespace"><xsl:value-of select=
"ancestor::book[namespace][1]/namespace" /></xsl:with-param>
276 <xsl:with-param name=
"namespace"><xsl:value-of select=
"@namespace" /></xsl:with-param>
277 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
280 <xsl:template match=
"/book[not(namespace)]//extension[@name]">
281 <xsl:call-template name=
"name-to-linked-extension">
282 <xsl:with-param name=
"namespace"><xsl:value-of select=
"@namespace" /></xsl:with-param>
283 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
287 <xsl:template match=
"guide-href[@name]">
288 <xsl:call-template name=
"guide-to-href">
289 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
293 <xsl:template match=
"a[(@part or @id) and not(@extension)]">
294 <xsl:element name=
"a">
295 <xsl:attribute name=
"href">
296 <xsl:if test=
"@part">
297 <xsl:call-template name=
"part-to-href">
298 <xsl:with-param name=
"name"><xsl:value-of select=
"@part" /></xsl:with-param>
302 <xsl:text>#
</xsl:text>
303 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
307 <xsl:when test=
"node()">
308 <xsl:apply-templates />
310 <xsl:when test=
"@part">
311 <span class=
"filename">
312 <xsl:call-template name=
"part-to-href">
313 <xsl:with-param name=
"name"><xsl:value-of select=
"@part" /></xsl:with-param>
318 <xsl:variable name=
"dstid">
319 <xsl:value-of select=
"@id" />
321 <xsl:apply-templates select=
"//section[@id=$dstid]/title" />
322 <xsl:apply-templates select=
"//example-with-output[@id=$dstid]/@title" />
327 <xsl:template match=
"a[@id]/title">
328 <xsl:variable name=
"dstid">
329 <xsl:value-of select=
"../@id" />
331 <xsl:apply-templates select=
"//section[@id=$dstid]/title" />
333 <xsl:template match=
"a[@extension]">
334 <xsl:element name=
"a">
335 <xsl:attribute name=
"href">
336 <xsl:call-template name=
"extension-to-href">
337 <xsl:with-param name=
"name"><xsl:value-of select=
"@extension" /></xsl:with-param>
340 <xsl:text>#
</xsl:text>
341 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
344 <span class=
"filename"><xsl:value-of select=
"@extension" /></span>
347 <xsl:template match=
"a[@guide]">
348 <xsl:element name=
"a">
349 <xsl:attribute name=
"href">
350 <xsl:call-template name=
"guide-to-href">
351 <xsl:with-param name=
"name"><xsl:value-of select=
"@guide" /></xsl:with-param>
354 <xsl:text>#
</xsl:text>
355 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
358 <xsl:apply-templates />
362 <xsl:template match='a[@
method=
"google-lucky" and @query]'
>
363 <xsl:element name=
"a">
364 <xsl:attribute name=
"href">http://www.google.com/search?btnI=I%
27m%
20Feeling%
20Lucky
&q=
<xsl:value-of select=
"encode-for-uri(@query)" /></xsl:attribute>
366 <xsl:when test=
"node()">
367 <xsl:apply-templates />
370 <xsl:text>[
</xsl:text><xsl:call-template name=
"str-Google" /><xsl:text>_lucky `
</xsl:text><xsl:value-of select=
"@query" /><xsl:text>´]
</xsl:text>
375 <xsl:template match='a[@
method=
"google" and @query]'
>
376 <xsl:element name=
"a">
377 <xsl:attribute name=
"href">http://www.google.com/search?q=
<xsl:value-of select=
"encode-for-uri(@query)" /></xsl:attribute>
379 <xsl:when test=
"node()">
380 <xsl:apply-templates />
383 <xsl:text>[
</xsl:text><xsl:call-template name=
"str-Google" /><xsl:text> `
</xsl:text><xsl:value-of select=
"@query" /><xsl:text>´]
</xsl:text>
388 <xsl:template match=
"a[@query]/query">
389 <xsl:value-of select=
"../@query" />
392 <xsl:template name=
"name-to-linked-type">
393 <xsl:param name=
"name" />
394 <xsl:element name=
"a">
395 <xsl:attribute name=
"class">discrete
</xsl:attribute>
396 <xsl:attribute name=
"href"><xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">types
</xsl:with-param></xsl:call-template>#type:
<xsl:value-of select=
"$name" /></xsl:attribute>
397 <xsl:call-template name=
"format-type-name">
398 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
402 <xsl:template name=
"name-to-linked-statetype">
403 <xsl:param name=
"name" />
404 <xsl:element name=
"a">
405 <xsl:attribute name=
"class">discrete
</xsl:attribute>
406 <xsl:attribute name=
"href"><xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">stete-types
</xsl:with-param></xsl:call-template>#statetype:
<xsl:value-of select=
"$name" /></xsl:attribute>
407 <xsl:call-template name=
"format-type-name">
408 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
413 <xsl:template match=
"named-type[@name and not(@link)]">
414 <xsl:call-template name=
"name-to-linked-type">
415 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
418 <xsl:template match=
"named-type[@name and @link='no']">
419 <xsl:call-template name=
"format-type-name">
420 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
424 <xsl:template match=
"named-statetype[@name and not(@link)]">
425 <xsl:call-template name=
"name-to-linked-statetype">
426 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
429 <xsl:template match=
"named-statetype[@name and @link='no']">
430 <xsl:call-template name=
"format-statetype-name">
431 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
434 <xsl:template match=
"parameter-type[@name]">
435 <xsl:call-template name=
"name-to-template-type">
436 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
440 <xsl:template name=
"format-template-type-name">
441 <xsl:param name=
"name" />
442 <span class=
"typename template">§
<xsl:value-of select=
"$name" /></span>
444 <xsl:template name=
"format-template-statetype-name">
445 <xsl:param name=
"name" />
446 <span class=
"typename template">§•
<xsl:value-of select=
"$name" /></span>
449 <xsl:template match=
"template-type[@name]">
450 <xsl:call-template name=
"format-template-type-name">
451 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
454 <xsl:template match=
"template-statetype[@name]">
455 <xsl:call-template name=
"format-template-statetype-name">
456 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
460 <xsl:template name=
"format-mutator-name">
461 <xsl:param name=
"name" />
462 <span class=
"varname"><xsl:value-of select=
"$name" /></span>
464 <xsl:template name=
"name-to-linked-mutator">
465 <xsl:param name=
"extension" />
466 <xsl:param name=
"extension-href" />
467 <xsl:param name=
"type" />
468 <xsl:param name=
"name" />
469 <xsl:element name=
"a">
470 <xsl:attribute name=
"class">discrete
</xsl:attribute>
471 <xsl:attribute name=
"href">
473 <xsl:when test=
"$extension">
474 <xsl:call-template name=
"extension-to-href"><xsl:with-param name=
"name"><xsl:value-of select=
"$extension" /></xsl:with-param></xsl:call-template>#mutator:
<xsl:value-of select=
"$type" />:
<xsl:value-of select=
"$name" />
476 <xsl:when test=
"$extension-href">
477 <xsl:value-of select=
"$extension-href" />#mutator:
<xsl:value-of select=
"$type" />:
<xsl:value-of select=
"$name" />
480 <xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">statetypes
</xsl:with-param></xsl:call-template>#mutator:
<xsl:value-of select=
"$type" />:
<xsl:value-of select=
"$name" />
484 <xsl:call-template name=
"format-statetype-name">
485 <xsl:with-param name=
"name"><xsl:value-of select=
"$type" /></xsl:with-param>
487 <span class=
"inline">/
</span>
488 <xsl:call-template name=
"format-mutator-name">
489 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
493 <xsl:template match=
"mutator[@type and @name and not(@extension)]">
494 <xsl:call-template name=
"name-to-linked-mutator">
495 <xsl:with-param name=
"type"><xsl:value-of select=
"@type" /></xsl:with-param>
496 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
499 <xsl:template match=
"mutator[@type and @name and @extension]">
500 <xsl:call-template name=
"name-to-linked-mutator">
501 <xsl:with-param name=
"extension"><xsl:value-of select=
"@extension" /></xsl:with-param>
502 <xsl:with-param name=
"type"><xsl:value-of select=
"@type" /></xsl:with-param>
503 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
507 <xsl:template name=
"name-to-tol-param">
508 <xsl:param name=
"name" />
509 <span class=
"tolparam"><xsl:value-of select=
"@name" /></span>
511 <xsl:template match=
"tol-param[@name and @link='no']">
512 <xsl:call-template name=
"name-to-operator">
513 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
516 <xsl:template match=
"tol-param[@name and not(@link)]">
517 <xsl:element name=
"a">
518 <xsl:attribute name=
"class">discrete
</xsl:attribute>
519 <xsl:attribute name=
"href"><xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">algo-tol
</xsl:with-param></xsl:call-template>#tol-
<xsl:value-of select=
"@name" /></xsl:attribute>
520 <xsl:call-template name=
"name-to-operator">
521 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
526 <xsl:template name=
"name-to-operator">
527 <xsl:param name=
"name" />
528 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
530 <xsl:template match=
"operator[@name]">
531 <xsl:call-template name=
"name-to-operator">
532 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
535 <xsl:template name=
"name-to-operator-unary-prefix">
536 <xsl:param name=
"name" />
537 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
539 <xsl:template match=
"operator-unary-prefix[@name]">
540 <xsl:call-template name=
"name-to-operator-unary-prefix">
541 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
545 <xsl:template name=
"format-namespace-name">
546 <xsl:param name=
"name" />
547 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
549 <xsl:template name=
"name-to-linked-namespace">
550 <xsl:param name=
"name" />
551 <xsl:element name=
"a">
552 <xsl:attribute name=
"class">discrete
</xsl:attribute>
553 <xsl:attribute name=
"href">
554 <xsl:call-template name=
"namespace-to-href"><xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param></xsl:call-template>
556 <xsl:call-template name=
"format-namespace-name">
557 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
561 <xsl:template match=
"user-namespace[@name]">
562 <xsl:call-template name=
"format-namespace-name">
563 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
566 <xsl:template match=
"namespace[@name]">
567 <xsl:call-template name=
"name-to-linked-namespace">
568 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
571 <xsl:template match=
"namespace[@current and @relative]">
572 <xsl:element name=
"a">
573 <xsl:attribute name=
"class">discrete
</xsl:attribute>
574 <xsl:attribute name=
"href">
575 <xsl:call-template name=
"namespace-to-href"><xsl:with-param name=
"name"><xsl:value-of select=
"@current" />..
<xsl:value-of select=
"@relative" /></xsl:with-param></xsl:call-template>
577 <xsl:call-template name=
"format-namespace-name">
578 <xsl:with-param name=
"name"><xsl:value-of select=
"@relative" /></xsl:with-param>
582 <xsl:template match=
"/book[namespace]//namespace[@relative and not(@current)]">
583 <xsl:element name=
"a">
584 <xsl:attribute name=
"class">discrete
</xsl:attribute>
585 <xsl:attribute name=
"href">
586 <xsl:call-template name=
"namespace-to-href"><xsl:with-param name=
"name"><xsl:value-of select=
"/book/namespace" />..
<xsl:value-of select=
"@relative" /></xsl:with-param></xsl:call-template>
588 <xsl:call-template name=
"format-namespace-name">
589 <xsl:with-param name=
"name"><xsl:value-of select=
"@relative" /></xsl:with-param>
594 <xsl:template match=
"em"><em><xsl:apply-templates/></em></xsl:template>
595 <xsl:template match=
"b"><b><xsl:apply-templates/></b></xsl:template>
596 <xsl:template match=
"weak"><span class=
"weak"><xsl:apply-templates/></span></xsl:template>
597 <xsl:template match=
"inline"><span class=
"inline"><xsl:apply-templates/></span></xsl:template>
598 <xsl:template match=
"bnf"><span class=
"bnf"><xsl:apply-templates/></span></xsl:template>
599 <xsl:template match=
"union-type">
600 <span class=
"typename"><xsl:text>(
</xsl:text></span>
601 <xsl:for-each select=
"./*">
602 <xsl:if test=
"position() > 1">
603 <span class=
"typestx"><xsl:text>∪
</xsl:text></span><xsl:text> </xsl:text>
605 <xsl:apply-templates select=
"." />
606 <xsl:text> </xsl:text>
608 <span class=
"typename">)
</span>
610 <xsl:template match=
"singleton-type">
611 <span class=
"typestx">§(
</span>
612 <xsl:apply-templates />
613 <span class=
"typestx">)
</span>
615 <xsl:template match=
"intersection-type">
616 <span class=
"typestx"><xsl:text>(
</xsl:text></span><xsl:text> </xsl:text>
617 <xsl:for-each select=
"./*">
618 <xsl:if test=
"position() > 1">
619 <span class=
"typestx"><xsl:text>∩
</xsl:text></span><xsl:text> </xsl:text>
621 <xsl:apply-templates select=
"." />
622 <xsl:text> </xsl:text>
624 <span class=
"typestx">)
</span>
626 <xsl:template name=
"name-to-field">
627 <xsl:param name=
"name" />
628 <fieldname><xsl:value-of select=
"$name" /></fieldname>
630 <xsl:template match=
"structure-type">
631 <span class=
"typestx"><xsl:text>(
></xsl:text></span><xsl:text> </xsl:text>
632 <xsl:for-each select=
"field">
633 <xsl:if test=
"@name">
634 <xsl:call-template name=
"name-to-field">
635 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
638 <xsl:if test=
"not(@name)">
639 <xsl:value-of select=
"position( )" />
642 <xsl:when test=
"type">
643 <xsl:text>::
</xsl:text><xsl:apply-templates select=
"type" />
645 <xsl:when test=
"value">
646 <xsl:text>:
</xsl:text><xsl:apply-templates select=
"value" />
649 <xsl:text>::
</xsl:text><typename>Any-Type
</typename>
652 <xsl:text> </xsl:text>
654 <span class=
"typestx"><)
</span>
656 <xsl:template match=
"function-type">
657 <span class=
"typestx"><xsl:text>(
</xsl:text></span><xsl:text> </xsl:text>
658 <xsl:apply-templates select=
"arguments" />
659 <xsl:text> </xsl:text><span class=
"typestx"><xsl:text>→
</xsl:text></span><xsl:text> </xsl:text>
660 <xsl:apply-templates select=
"result" />
661 <xsl:text> </xsl:text><span class=
"typestx"><xsl:text>)
</xsl:text></span>
663 <xsl:template match=
"typename"><span class=
"typename"><xsl:apply-templates/></span></xsl:template>
664 <xsl:template match=
"typename[@class='replacable']">
665 <span class=
"typename replacable"><xsl:apply-templates/></span>
667 <xsl:template match=
"replacable-text[@name]">
668 <span class=
"varname replacable"><xsl:value-of select=
"@name" /></span>
670 <xsl:template match=
"parameterized-type">
671 <span class=
"typestx"><xsl:text>[
</xsl:text></span>
672 <xsl:call-template name=
"name-to-linked-type">
673 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
675 <xsl:for-each select=
"./*">
676 <xsl:text> </xsl:text>
677 <xsl:apply-templates select=
"." />
679 <span class=
"typestx"><xsl:text>]
</xsl:text></span>
682 <xsl:template name=
"name-to-argument">
683 <xsl:param name=
"name" />
684 <xsl:param name=
"class" />
685 <xsl:element name=
"span">
686 <xsl:attribute name=
"class">varname
<xsl:value-of select=
"$class" /></xsl:attribute>
687 <xsl:value-of select=
"$name" />
690 <xsl:template match=
"p/arg[@name] | td/arg[@name] | singleton-type/arg[@name]">
691 <xsl:call-template name=
"name-to-argument">
692 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
693 <xsl:with-param name=
"class"><xsl:value-of select=
"@class" /></xsl:with-param>
697 <xsl:template name=
"name-to-state-argument">
698 <xsl:param name=
"name" />
699 <xsl:param name=
"class" />
700 <xsl:element name=
"span">
701 <xsl:attribute name=
"class">varname
<xsl:value-of select=
"$class" /></xsl:attribute>
702 <xsl:call-template name=
"format-state-name">
703 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
707 <xsl:template match=
"state-arg[@name]">
708 <xsl:call-template name=
"name-to-state-argument">
709 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
710 <xsl:with-param name=
"class"><xsl:value-of select=
"@class" /></xsl:with-param>
714 <xsl:template match=
"field[@name and not(@class)]">
715 <span class=
"varname"><xsl:value-of select=
"@name" /></span>
717 <xsl:template match=
"field[@name and @class='replacable']">
718 <span class=
"varname replacable"><xsl:value-of select=
"@name" /></span>
721 <xsl:template match=
"lexerregexp">
722 <span class=
"lexerregexp"><xsl:apply-templates/></span>
724 <xsl:template match=
"syntax[@name and @class='new']">
725 <xsl:element name=
"a">
726 <xsl:attribute name=
"name">stx-.
<xsl:value-of select=
"@name" /></xsl:attribute>
727 <span class=
"syntaxname-new"><xsl:value-of select=
"@name"/></span>
730 <xsl:template match=
"syntax[@name and not(@class)]">
731 <xsl:element name=
"a">
732 <xsl:attribute name=
"class">discrete
</xsl:attribute>
733 <xsl:attribute name=
"href"><xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">syntax
</xsl:with-param></xsl:call-template>#stx-.
<xsl:value-of select=
"@name" /></xsl:attribute>
734 <span class=
"syntaxname"><xsl:value-of select=
"@name"/></span>
737 <xsl:template match=
"a[@href]">
738 <xsl:element name=
"a">
739 <xsl:attribute name=
"href"><xsl:value-of select=
"@href" /></xsl:attribute>
740 <xsl:apply-templates/>
744 <xsl:template match=
"unit">
745 <xsl:element name=
"span">
746 <xsl:attribute name=
"class">
747 <xsl:text>unit
</xsl:text>
748 <xsl:if test=
"@class"><xsl:text> </xsl:text><xsl:value-of select=
"@class" /></xsl:if>
750 <xsl:apply-templates/>
754 <xsl:template match=
"filename"><span class=
"filename"><xsl:value-of select=
"." /></span></xsl:template>
755 <xsl:template match=
"progname"><span class=
"terminal"><xsl:value-of select=
"." /></span></xsl:template>
756 <xsl:template match=
"command-line">
757 <pre class=
"terminal">
758 <xsl:apply-templates/>
762 <xsl:template match=
"tight-table">
763 <table class=
"tight"><xsl:apply-templates select=
"head/tr | body/tr"/></table>
765 <xsl:template match=
"loose-table">
766 <table class=
"loose"><xsl:apply-templates select=
"head/tr | body/tr"/></table>
769 <xsl:template match=
"tr">
770 <tr><xsl:apply-templates/></tr>
772 <xsl:template match=
"tr[@align]">
773 <xsl:element name=
"tr">
774 <xsl:attribute name=
"align"><xsl:value-of select=
"./@align" /></xsl:attribute>
775 <xsl:apply-templates/>
778 <xsl:template match=
"head/tr/td">
779 <th><xsl:apply-templates/></th>
781 <xsl:template match=
"td">
782 <td><xsl:apply-templates/></td>
784 <xsl:template match=
"th">
785 <th><xsl:apply-templates/></th>
787 <xsl:template match=
"th[@colspan]">
788 <xsl:element name=
"th">
789 <xsl:attribute name=
"colspan"><xsl:value-of select=
"./@colspan" /></xsl:attribute>
790 <xsl:apply-templates/>
794 <xsl:template match=
"img">
796 <xsl:when test=
"@target">
797 <xsl:element name=
"a">
798 <xsl:attribute name=
"href"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
799 <xsl:attribute name=
"target"><xsl:value-of select=
"@target" /></xsl:attribute>
800 <xsl:element name=
"img">
801 <xsl:if test=
"@class">
802 <xsl:attribute name=
"class"><xsl:value-of select=
"@class" /></xsl:attribute>
804 <xsl:attribute name=
"src"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
805 <xsl:attribute name=
"alt"><xsl:value-of select=
"@alt" /></xsl:attribute>
806 <xsl:if test=
"@width"><xsl:attribute name=
"width"><xsl:value-of select=
"@width" /></xsl:attribute></xsl:if>
807 <xsl:if test=
"@height"><xsl:attribute name=
"height"><xsl:value-of select=
"@height" /></xsl:attribute></xsl:if>
812 <xsl:element name=
"img">
813 <xsl:if test=
"@class">
814 <xsl:attribute name=
"class"><xsl:value-of select=
"@class" /></xsl:attribute>
816 <xsl:attribute name=
"src"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
817 <xsl:attribute name=
"alt"><xsl:value-of select=
"@alt" /></xsl:attribute>
818 <xsl:if test=
"@width"><xsl:attribute name=
"width"><xsl:value-of select=
"@width" /></xsl:attribute></xsl:if>
819 <xsl:if test=
"@height"><xsl:attribute name=
"height"><xsl:value-of select=
"@height" /></xsl:attribute></xsl:if>
824 <xsl:template match=
"figure[image]">
826 <table class=
"figure">
827 <tr align=
"center"><td>
829 <xsl:element name=
"a">
830 <xsl:attribute name=
"name"><xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template></xsl:attribute>
833 <xsl:apply-templates select=
"image/*" />
835 <tr><td class=
"here-caption">
836 <xsl:apply-templates select=
"caption/*" />
843 <xsl:template match=
"arguments">
844 <xsl:for-each select=
"arg | state">
845 <xsl:if test=
"position() > 1">
846 <xsl:text> </xsl:text>
848 <xsl:apply-templates select=
"." />
851 <xsl:if test=
"arg | state">
852 <xsl:text> </xsl:text>
854 <xsl:apply-templates select=
"sink"/>
858 <xsl:template match=
"arguments/arg">
859 <xsl:if test=
"@identifier">
860 <xsl:call-template name=
"name-to-argument"><xsl:with-param name=
"name"><xsl:value-of select=
"@identifier" /></xsl:with-param></xsl:call-template>
862 <xsl:apply-templates select=
"default"/>
863 <xsl:apply-templates select=
"type"/>
865 <xsl:template match=
"arguments/arg/default">:
<xsl:apply-templates /></xsl:template>
866 <xsl:template match=
"arguments/arg/type"><xsl:text>::
</xsl:text><xsl:apply-templates select=
"*" /></xsl:template>
868 <xsl:template match=
"arguments/state[@identifier]">
869 <xsl:call-template name=
"name-to-state-argument"><xsl:with-param name=
"name"><xsl:value-of select=
"@identifier" /></xsl:with-param></xsl:call-template>
870 <xsl:apply-templates select=
"type"/>
872 <xsl:template match=
"arguments/state[not(@identifier)]">
873 <xsl:apply-templates select=
"type"/>
875 <xsl:template match=
"arguments/state/type"><xsl:text>::
</xsl:text><xsl:apply-templates /></xsl:template>
877 <xsl:template match=
"arguments/sink[@identifier]">
878 <xsl:text><></xsl:text><xsl:call-template name=
"name-to-argument"><xsl:with-param name=
"name"><xsl:value-of select=
"@identifier" /></xsl:with-param></xsl:call-template>
879 <xsl:apply-templates select=
"type"/>
881 <xsl:template match=
"arguments/sink[not(@identifier)]">
882 <xsl:text><></xsl:text>
883 <xsl:apply-templates select=
"type"/>
885 <xsl:template match=
"arguments/sink/type"><xsl:text>::{
</xsl:text><xsl:apply-templates /><xsl:text>}
</xsl:text></xsl:template>
887 <xsl:template match=
"type-templates">
888 <table class=
"type-templates">
889 <xsl:apply-templates />
892 <xsl:template match=
"type-templates/template[@name]">
894 <td align=
"right"><xsl:call-template name=
"format-template-type-name"><xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param></xsl:call-template> </td>
896 <xsl:apply-templates select=
"description"/>
900 <xsl:template match=
"type-templates/template-state[@name]">
902 <td align=
"right"><xsl:call-template name=
"format-template-statetype-name"><xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param></xsl:call-template> </td>
904 <xsl:apply-templates select=
"description"/>
909 <xsl:template match=
"book[namespace and not(extension)]/title/self">
910 <xsl:value-of select=
"../../namespace" />
912 <xsl:template match=
"/book[namespace and not(extension)]/top/p/self">
913 <xsl:call-template name=
"format-namespace-name">
914 <xsl:with-param name=
"name"><xsl:value-of select=
"/book/namespace" /></xsl:with-param>
918 <xsl:template match=
"book[namespace and extension]/title/self">
919 <xsl:value-of select=
"../../extension" />
921 <xsl:template match=
"/book[namespace and extension]/top/p/self">
922 <span class=
"filename"><xsl:value-of select=
"ancestor::book/extension" /></span>
925 <xsl:template match=
"book[namespace and not(extension)]/meta-selflink/self-href">
926 <xsl:call-template name=
"namespace-to-href">
927 <xsl:with-param name=
"name"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
930 <xsl:template match=
"book[namespace and extension]/meta-selflink/self-href">
931 <xsl:call-template name=
"extension-to-href">
932 <xsl:with-param name=
"namespace"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
933 <xsl:with-param name=
"name"><xsl:value-of select=
"../../extension" /></xsl:with-param>
937 <xsl:template match=
"book[namespace and not(extension)]/up-link/parent-namespace">
938 <xsl:variable name=
"ns"><xsl:value-of select=
"../../namespace" /></xsl:variable>
939 <xsl:call-template name=
"name-to-linked-namespace">
940 <xsl:with-param name=
"name"><xsl:value-of select=
"replace($ns, '\.\.[^.]*$', '')" /></xsl:with-param>
943 <xsl:template match=
"book[namespace and extension]/up-link/parent-namespace">
944 <xsl:call-template name=
"name-to-linked-namespace">
945 <xsl:with-param name=
"name"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
949 <xsl:template match=
"type-parameters">
950 <table class=
"type-templates">
951 <xsl:apply-templates />
954 <xsl:template match=
"type-parameters/parameter[@name]">
956 <td align=
"right"><xsl:call-template name=
"name-to-template-type"><xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param></xsl:call-template> </td>
958 <xsl:apply-templates select=
"description"/>
962 <xsl:template match=
"type-parameters/parameter-state[@name]">
964 <td align=
"right"><xsl:call-template name=
"name-to-template-state-type"><xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param></xsl:call-template> </td>
966 <xsl:apply-templates select=
"description"/>
971 <xsl:template name=
"SF-placeholder" >
972 <xsl:comment>PUT-SF-LOGO-HERE
</xsl:comment>
975 <xsl:template match=
"eq"><span class=
"eq"><xsl:apply-templates/></span></xsl:template>
976 <xsl:template match=
"eq//op"><span class=
"rm"><xsl:apply-templates/></span></xsl:template>
977 <xsl:template match=
"eq//rm"><span class=
"rm"><xsl:apply-templates/></span></xsl:template>
978 <xsl:template match=
"eq//text"><span class=
"text"><xsl:apply-templates/></span></xsl:template>
979 <xsl:template match=
"eq//sub"><sub><xsl:apply-templates/></sub></xsl:template>
980 <xsl:template match=
"eq//sup"><sup><xsl:apply-templates/></sup></xsl:template>