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='types'">types.html
</xsl:when>
151 <xsl:when test=
"$name='state-types'">state-types.html
</xsl:when>
152 <xsl:when test=
"$name='algo-tol'">algo-tol.html
</xsl:when>
153 <xsl:when test=
"$name='man'">man.html
</xsl:when>
154 <xsl:when test=
"$name='tutorial'">tutorial.html
</xsl:when>
155 <xsl:when test=
"$name='guides'">guides/index.html
</xsl:when>
156 <xsl:when test=
"$name='extensions'">extensions/index.html
</xsl:when>
157 <xsl:when test=
"$name='install'">install.html
</xsl:when>
158 <xsl:when test=
"$name='interactive'">interactive.html
</xsl:when>
159 <xsl:when test=
"$name='edit'">edit.html
</xsl:when>
160 <xsl:when test=
"$name='namespace-index'">namespace-index.html
</xsl:when>
163 <xsl:template name=
"extension-to-href">
164 <xsl:param name=
"namespace" />
165 <xsl:param name=
"name" />
167 <xsl:when test=
"$namespace">
168 <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>
171 <xsl:value-of select=
"/book/base/@href" /><xsl:text>extensions/
</xsl:text><xsl:value-of select=
"$name" /><xsl:text>.html
</xsl:text>
175 <xsl:template name=
"guide-to-href">
176 <xsl:param name=
"name" />
177 <xsl:value-of select=
"/book/base/@href" /><xsl:text>guides/
</xsl:text><xsl:value-of select=
"$name" /><xsl:text>.html
</xsl:text>
179 <xsl:template name=
"id-to-anchor-name">
180 <xsl:param name=
"id" />
181 <xsl:value-of select=
"replace(replace(concat('secid:', $id), '-', '--'), '/', '-.')" />
183 <xsl:template name=
"env-var-to-anchor-name">
184 <xsl:param name=
"id" />
185 <xsl:value-of select=
"replace(replace(concat('env:', $id), '-', '--'), '/', '-.')" />
188 <xsl:template match=
"env-var[@name]">
189 <xsl:element name=
"a">
190 <xsl:attribute name=
"class">discrete
</xsl:attribute>
191 <xsl:attribute name=
"href">
192 <xsl:call-template name=
"part-to-href">
193 <xsl:with-param name=
"name">man
</xsl:with-param>
194 </xsl:call-template>#
<xsl:call-template name=
"env-var-to-anchor-name">
195 <xsl:with-param name=
"id"><xsl:value-of select=
"@name" /></xsl:with-param>
198 <xsl:value-of select=
"@name" />
202 <xsl:template match=
"part-href[@name]">
203 <xsl:call-template name=
"part-to-href">
204 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
207 <xsl:template match=
"extension-href[@name]">
208 <xsl:call-template name=
"extension-to-href">
209 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
212 <xsl:template name=
"name-to-linked-extension">
213 <xsl:param name=
"current-namespace" />
214 <xsl:param name=
"namespace" />
215 <xsl:param name=
"name" />
216 <xsl:variable name=
"ns">
218 <xsl:when test=
"starts-with($namespace, '..')">
219 <xsl:value-of select=
"$namespace" />
221 <xsl:when test=
"$namespace = ''">
222 <xsl:value-of select=
"$current-namespace" />
224 <xsl:when test=
"$current-namespace = '..'">
225 <xsl:value-of select=
"concat('..', $namespace)" />
228 <xsl:value-of select=
"concat($current-namespace, '..', $namespace)" />
232 <xsl:element name=
"a">
233 <xsl:attribute name=
"class">discrete
</xsl:attribute>
234 <xsl:attribute name=
"href">
235 <xsl:call-template name=
"extension-to-href">
236 <xsl:with-param name=
"namespace"><xsl:value-of select=
"$ns" /></xsl:with-param>
237 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
241 <xsl:when test=
"$ns = $current-namespace">
242 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
244 <xsl:when test=
"$current-namespace != ''">
245 <xsl:variable name=
"prefix">^
<xsl:value-of select=
"$current-namespace" />\.\.
</xsl:variable>
246 <xsl:call-template name=
"format-namespace-name">
247 <xsl:with-param name=
"name"><xsl:value-of select=
"replace($ns, $prefix, '')" /></xsl:with-param>
249 <xsl:text> /
</xsl:text>
250 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
253 <xsl:call-template name=
"format-namespace-name">
254 <xsl:with-param name=
"name"><xsl:value-of select=
"$ns" /></xsl:with-param>
256 <xsl:text> /
</xsl:text>
257 <span class=
"filename"><xsl:value-of select=
"$name" /></span>
262 <xsl:template match=
"extension[@path]">
263 <xsl:variable name=
"namespace"><xsl:value-of select=
"replace(@path, '/.*$', '')" /></xsl:variable>
264 <xsl:variable name=
"name"><xsl:value-of select=
"replace(@path, '^.*/', '')" /></xsl:variable>
265 <xsl:call-template name=
"name-to-linked-extension">
266 <xsl:with-param name=
"namespace"><xsl:value-of select=
"$namespace" /></xsl:with-param>
267 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
270 <xsl:template match=
"/book[namespace]//extension[@name]">
271 <xsl:call-template name=
"name-to-linked-extension">
272 <xsl:with-param name=
"current-namespace"><xsl:value-of select=
"ancestor::book[namespace][1]/namespace" /></xsl:with-param>
273 <xsl:with-param name=
"namespace"><xsl:value-of select=
"@namespace" /></xsl:with-param>
274 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
277 <xsl:template match=
"/book[not(namespace)]//extension[@name]">
278 <xsl:call-template name=
"name-to-linked-extension">
279 <xsl:with-param name=
"namespace"><xsl:value-of select=
"@namespace" /></xsl:with-param>
280 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
284 <xsl:template match=
"guide-href[@name]">
285 <xsl:call-template name=
"guide-to-href">
286 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
290 <xsl:template match=
"a[(@part or @id) and not(@extension)]">
291 <xsl:element name=
"a">
292 <xsl:attribute name=
"href">
293 <xsl:if test=
"@part">
294 <xsl:call-template name=
"part-to-href">
295 <xsl:with-param name=
"name"><xsl:value-of select=
"@part" /></xsl:with-param>
299 <xsl:text>#
</xsl:text>
300 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
304 <xsl:when test=
"node()">
305 <xsl:apply-templates />
307 <xsl:when test=
"@part">
308 <span class=
"filename">
309 <xsl:call-template name=
"part-to-href">
310 <xsl:with-param name=
"name"><xsl:value-of select=
"@part" /></xsl:with-param>
315 <xsl:variable name=
"dstid">
316 <xsl:value-of select=
"@id" />
318 <xsl:apply-templates select=
"//section[@id=$dstid]/title" />
319 <xsl:apply-templates select=
"//example-with-output[@id=$dstid]/@title" />
324 <xsl:template match=
"a[@id]/title">
325 <xsl:variable name=
"dstid">
326 <xsl:value-of select=
"../@id" />
328 <xsl:apply-templates select=
"//section[@id=$dstid]/title" />
330 <xsl:template match=
"a[@extension]">
331 <xsl:element name=
"a">
332 <xsl:attribute name=
"href">
333 <xsl:call-template name=
"extension-to-href">
334 <xsl:with-param name=
"name"><xsl:value-of select=
"@extension" /></xsl:with-param>
337 <xsl:text>#
</xsl:text>
338 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
341 <span class=
"filename"><xsl:value-of select=
"@extension" /></span>
344 <xsl:template match=
"a[@guide]">
345 <xsl:element name=
"a">
346 <xsl:attribute name=
"href">
347 <xsl:call-template name=
"guide-to-href">
348 <xsl:with-param name=
"name"><xsl:value-of select=
"@guide" /></xsl:with-param>
351 <xsl:text>#
</xsl:text>
352 <xsl:call-template name=
"id-to-anchor-name"><xsl:with-param name=
"id"><xsl:value-of select=
"@id" /></xsl:with-param></xsl:call-template>
355 <xsl:apply-templates />
359 <xsl:template match='a[@
method=
"google-lucky" and @query]'
>
360 <xsl:element name=
"a">
361 <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>
363 <xsl:when test=
"node()">
364 <xsl:apply-templates />
367 <xsl:text>[
</xsl:text><xsl:call-template name=
"str-Google" /><xsl:text>_lucky `
</xsl:text><xsl:value-of select=
"@query" /><xsl:text>´]
</xsl:text>
372 <xsl:template match='a[@
method=
"google" and @query]'
>
373 <xsl:element name=
"a">
374 <xsl:attribute name=
"href">http://www.google.com/search?q=
<xsl:value-of select=
"encode-for-uri(@query)" /></xsl:attribute>
376 <xsl:when test=
"node()">
377 <xsl:apply-templates />
380 <xsl:text>[
</xsl:text><xsl:call-template name=
"str-Google" /><xsl:text> `
</xsl:text><xsl:value-of select=
"@query" /><xsl:text>´]
</xsl:text>
385 <xsl:template match=
"a[@query]/query">
386 <xsl:value-of select=
"../@query" />
389 <xsl:template name=
"name-to-linked-type">
390 <xsl:param name=
"name" />
391 <xsl:element name=
"a">
392 <xsl:attribute name=
"class">discrete
</xsl:attribute>
393 <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>
394 <xsl:call-template name=
"format-type-name">
395 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
399 <xsl:template name=
"name-to-linked-statetype">
400 <xsl:param name=
"name" />
401 <xsl:element name=
"a">
402 <xsl:attribute name=
"class">discrete
</xsl:attribute>
403 <xsl:attribute name=
"href"><xsl:call-template name=
"part-to-href"><xsl:with-param name=
"name">state-types
</xsl:with-param></xsl:call-template>#statetype:
<xsl:value-of select=
"$name" /></xsl:attribute>
404 <xsl:call-template name=
"format-statetype-name">
405 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
410 <xsl:template match=
"named-type[@name and not(@link)]">
411 <xsl:call-template name=
"name-to-linked-type">
412 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
415 <xsl:template match=
"named-type[@name and @link='no']">
416 <xsl:call-template name=
"format-type-name">
417 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
421 <xsl:template match=
"named-statetype[@name and not(@link)]">
422 <xsl:call-template name=
"name-to-linked-statetype">
423 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
426 <xsl:template match=
"named-statetype[@name and @link='no']">
427 <xsl:call-template name=
"format-statetype-name">
428 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
432 <xsl:template name=
"format-template-type-name">
433 <xsl:param name=
"name" />
434 <span class=
"typename template">§
<xsl:value-of select=
"$name" /></span>
436 <xsl:template name=
"format-template-statetype-name">
437 <xsl:param name=
"name" />
438 <span class=
"typename template">§•
<xsl:value-of select=
"$name" /></span>
441 <xsl:template match=
"parameter-type[@name]">
442 <xsl:call-template name=
"format-template-type-name">
443 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
446 <xsl:template match=
"template-type[@name]">
447 <xsl:call-template name=
"format-template-type-name">
448 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
451 <xsl:template match=
"template-statetype[@name]">
452 <xsl:call-template name=
"format-template-statetype-name">
453 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
457 <xsl:template name=
"format-mutator-name">
458 <xsl:param name=
"name" />
459 <span class=
"varname"><xsl:value-of select=
"$name" /></span>
461 <xsl:template name=
"name-to-linked-mutator">
462 <xsl:param name=
"extension" />
463 <xsl:param name=
"extension-href" />
464 <xsl:param name=
"type" />
465 <xsl:param name=
"name" />
466 <xsl:element name=
"a">
467 <xsl:attribute name=
"class">discrete
</xsl:attribute>
468 <xsl:attribute name=
"href">
470 <xsl:when test=
"$extension">
471 <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" />
473 <xsl:when test=
"$extension-href">
474 <xsl:value-of select=
"$extension-href" />#mutator:
<xsl:value-of select=
"$type" />:
<xsl:value-of select=
"$name" />
477 <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" />
481 <xsl:call-template name=
"format-statetype-name">
482 <xsl:with-param name=
"name"><xsl:value-of select=
"$type" /></xsl:with-param>
484 <span class=
"inline">/
</span>
485 <xsl:call-template name=
"format-mutator-name">
486 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
490 <xsl:template match=
"mutator[@type and @name and not(@extension)]">
491 <xsl:call-template name=
"name-to-linked-mutator">
492 <xsl:with-param name=
"type"><xsl:value-of select=
"@type" /></xsl:with-param>
493 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
496 <xsl:template match=
"mutator[@type and @name and @extension]">
497 <xsl:call-template name=
"name-to-linked-mutator">
498 <xsl:with-param name=
"extension"><xsl:value-of select=
"@extension" /></xsl:with-param>
499 <xsl:with-param name=
"type"><xsl:value-of select=
"@type" /></xsl:with-param>
500 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
504 <xsl:template name=
"name-to-tol-param">
505 <xsl:param name=
"name" />
506 <span class=
"tolparam"><xsl:value-of select=
"@name" /></span>
508 <xsl:template match=
"tol-param[@name and @link='no']">
509 <xsl:call-template name=
"name-to-operator">
510 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
513 <xsl:template match=
"tol-param[@name and not(@link)]">
514 <xsl:element name=
"a">
515 <xsl:attribute name=
"class">discrete
</xsl:attribute>
516 <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>
517 <xsl:call-template name=
"name-to-operator">
518 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
523 <xsl:template name=
"name-to-operator">
524 <xsl:param name=
"name" />
525 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
527 <xsl:template match=
"operator[@name]">
528 <xsl:call-template name=
"name-to-operator">
529 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
532 <xsl:template name=
"name-to-operator-unary-prefix">
533 <xsl:param name=
"name" />
534 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
536 <xsl:template match=
"operator-unary-prefix[@name]">
537 <xsl:call-template name=
"name-to-operator-unary-prefix">
538 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
542 <xsl:template name=
"format-namespace-name">
543 <xsl:param name=
"name" />
544 <span class=
"inline"><xsl:value-of select=
"$name" /></span>
546 <xsl:template name=
"name-to-linked-namespace">
547 <xsl:param name=
"name" />
548 <xsl:element name=
"a">
549 <xsl:attribute name=
"class">discrete
</xsl:attribute>
550 <xsl:attribute name=
"href">
551 <xsl:call-template name=
"namespace-to-href"><xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param></xsl:call-template>
553 <xsl:call-template name=
"format-namespace-name">
554 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
558 <xsl:template match=
"user-namespace[@name]">
559 <xsl:call-template name=
"format-namespace-name">
560 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
563 <xsl:template match=
"namespace[@name]">
564 <xsl:call-template name=
"name-to-linked-namespace">
565 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
568 <xsl:template match=
"namespace[@current and @relative]">
569 <xsl:element name=
"a">
570 <xsl:attribute name=
"class">discrete
</xsl:attribute>
571 <xsl:attribute name=
"href">
572 <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>
574 <xsl:call-template name=
"format-namespace-name">
575 <xsl:with-param name=
"name"><xsl:value-of select=
"@relative" /></xsl:with-param>
579 <xsl:template match=
"/book[namespace]//namespace[@relative and not(@current)]">
580 <xsl:element name=
"a">
581 <xsl:attribute name=
"class">discrete
</xsl:attribute>
582 <xsl:attribute name=
"href">
583 <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>
585 <xsl:call-template name=
"format-namespace-name">
586 <xsl:with-param name=
"name"><xsl:value-of select=
"@relative" /></xsl:with-param>
591 <xsl:template match=
"em"><em><xsl:apply-templates/></em></xsl:template>
592 <xsl:template match=
"b"><b><xsl:apply-templates/></b></xsl:template>
593 <xsl:template match=
"weak"><span class=
"weak"><xsl:apply-templates/></span></xsl:template>
594 <xsl:template match=
"inline"><span class=
"inline"><xsl:apply-templates/></span></xsl:template>
595 <xsl:template match=
"bnf"><span class=
"bnf"><xsl:apply-templates/></span></xsl:template>
596 <xsl:template match=
"union-type">
597 <span class=
"typename"><xsl:text>(
</xsl:text></span>
598 <xsl:for-each select=
"./*">
599 <xsl:if test=
"position() > 1">
600 <span class=
"typestx"><xsl:text>∪
</xsl:text></span><xsl:text> </xsl:text>
602 <xsl:apply-templates select=
"." />
603 <xsl:text> </xsl:text>
605 <span class=
"typename">)
</span>
607 <xsl:template match=
"singleton-type">
608 <span class=
"typestx">§(
</span>
609 <xsl:apply-templates />
610 <span class=
"typestx">)
</span>
612 <xsl:template match=
"intersection-type">
613 <span class=
"typestx"><xsl:text>(
</xsl:text></span><xsl:text> </xsl:text>
614 <xsl:for-each select=
"./*">
615 <xsl:if test=
"position() > 1">
616 <span class=
"typestx"><xsl:text>∩
</xsl:text></span><xsl:text> </xsl:text>
618 <xsl:apply-templates select=
"." />
619 <xsl:text> </xsl:text>
621 <span class=
"typestx">)
</span>
623 <xsl:template name=
"name-to-field">
624 <xsl:param name=
"name" />
625 <fieldname><xsl:value-of select=
"$name" /></fieldname>
627 <xsl:template match=
"structure-type">
628 <span class=
"typestx"><xsl:text>(
></xsl:text></span><xsl:text> </xsl:text>
629 <xsl:for-each select=
"field">
630 <xsl:if test=
"@name">
631 <xsl:call-template name=
"name-to-field">
632 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
635 <xsl:if test=
"not(@name)">
636 <xsl:value-of select=
"position( )" />
639 <xsl:when test=
"type">
640 <xsl:text>::
</xsl:text><xsl:apply-templates select=
"type" />
642 <xsl:when test=
"value">
643 <xsl:text>:
</xsl:text><xsl:apply-templates select=
"value" />
646 <xsl:text>::
</xsl:text><typename>Any-Type
</typename>
649 <xsl:text> </xsl:text>
651 <span class=
"typestx"><)
</span>
653 <xsl:template match=
"function-type">
654 <span class=
"typestx"><xsl:text>(
</xsl:text></span><xsl:text> </xsl:text>
655 <xsl:apply-templates select=
"arguments" />
656 <xsl:text> </xsl:text><span class=
"typestx"><xsl:text>→
</xsl:text></span><xsl:text> </xsl:text>
657 <xsl:apply-templates select=
"result" />
658 <xsl:text> </xsl:text><span class=
"typestx"><xsl:text>)
</xsl:text></span>
660 <xsl:template match=
"typename"><span class=
"typename"><xsl:apply-templates/></span></xsl:template>
661 <xsl:template match=
"typename[@class='replacable']">
662 <span class=
"typename replacable"><xsl:apply-templates/></span>
664 <xsl:template match=
"replacable-text[@name]">
665 <span class=
"varname replacable"><xsl:value-of select=
"@name" /></span>
667 <xsl:template match=
"parameterized-type">
668 <span class=
"typestx"><xsl:text>[
</xsl:text></span>
669 <xsl:call-template name=
"name-to-linked-type">
670 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
672 <xsl:for-each select=
"./*">
673 <xsl:text> </xsl:text>
674 <xsl:apply-templates select=
"." />
676 <span class=
"typestx"><xsl:text>]
</xsl:text></span>
679 <xsl:template name=
"name-to-argument">
680 <xsl:param name=
"name" />
681 <xsl:param name=
"class" />
682 <xsl:element name=
"span">
683 <xsl:attribute name=
"class">varname
<xsl:value-of select=
"$class" /></xsl:attribute>
684 <xsl:value-of select=
"$name" />
687 <xsl:template match=
"p/arg[@name] | td/arg[@name] | singleton-type/arg[@name]">
688 <xsl:call-template name=
"name-to-argument">
689 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
690 <xsl:with-param name=
"class"><xsl:value-of select=
"@class" /></xsl:with-param>
694 <xsl:template name=
"name-to-state-argument">
695 <xsl:param name=
"name" />
696 <xsl:param name=
"class" />
697 <xsl:element name=
"span">
698 <xsl:attribute name=
"class">varname
<xsl:value-of select=
"$class" /></xsl:attribute>
699 <xsl:call-template name=
"format-state-name">
700 <xsl:with-param name=
"name"><xsl:value-of select=
"$name" /></xsl:with-param>
704 <xsl:template match=
"state-arg[@name]">
705 <xsl:call-template name=
"name-to-state-argument">
706 <xsl:with-param name=
"name"><xsl:value-of select=
"@name" /></xsl:with-param>
707 <xsl:with-param name=
"class"><xsl:value-of select=
"@class" /></xsl:with-param>
711 <xsl:template match=
"field[@name and not(@class)]">
712 <span class=
"varname"><xsl:value-of select=
"@name" /></span>
714 <xsl:template match=
"field[@name and @class='replacable']">
715 <span class=
"varname replacable"><xsl:value-of select=
"@name" /></span>
718 <xsl:template match=
"lexerregexp">
719 <span class=
"lexerregexp"><xsl:apply-templates/></span>
721 <xsl:template match=
"syntax[@name and @class='new']">
722 <xsl:element name=
"a">
723 <xsl:attribute name=
"name">stx-.
<xsl:value-of select=
"@name" /></xsl:attribute>
724 <span class=
"syntaxname-new"><xsl:value-of select=
"@name"/></span>
727 <xsl:template match=
"syntax[@name and not(@class)]">
728 <xsl:element name=
"a">
729 <xsl:attribute name=
"class">discrete
</xsl:attribute>
730 <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>
731 <span class=
"syntaxname"><xsl:value-of select=
"@name"/></span>
734 <xsl:template match=
"a[@href]">
735 <xsl:element name=
"a">
736 <xsl:attribute name=
"href"><xsl:value-of select=
"@href" /></xsl:attribute>
737 <xsl:apply-templates/>
741 <xsl:template match=
"unit">
742 <xsl:element name=
"span">
743 <xsl:attribute name=
"class">
744 <xsl:text>unit
</xsl:text>
745 <xsl:if test=
"@class"><xsl:text> </xsl:text><xsl:value-of select=
"@class" /></xsl:if>
747 <xsl:apply-templates/>
751 <xsl:template match=
"filename"><span class=
"filename"><xsl:value-of select=
"." /></span></xsl:template>
752 <xsl:template match=
"progname"><span class=
"terminal"><xsl:value-of select=
"." /></span></xsl:template>
753 <xsl:template match=
"command-line">
754 <pre class=
"terminal">
755 <xsl:apply-templates/>
759 <xsl:template match=
"tight-table">
760 <table class=
"tight"><xsl:apply-templates select=
"head/tr | body/tr"/></table>
762 <xsl:template match=
"loose-table">
763 <table class=
"loose"><xsl:apply-templates select=
"head/tr | body/tr"/></table>
766 <xsl:template match=
"tr">
767 <tr><xsl:apply-templates/></tr>
769 <xsl:template match=
"tr[@align]">
770 <xsl:element name=
"tr">
771 <xsl:attribute name=
"align"><xsl:value-of select=
"./@align" /></xsl:attribute>
772 <xsl:apply-templates/>
775 <xsl:template match=
"head/tr/td">
776 <th><xsl:apply-templates/></th>
778 <xsl:template match=
"td">
779 <td><xsl:apply-templates/></td>
781 <xsl:template match=
"th">
782 <th><xsl:apply-templates/></th>
784 <xsl:template match=
"th[@colspan]">
785 <xsl:element name=
"th">
786 <xsl:attribute name=
"colspan"><xsl:value-of select=
"./@colspan" /></xsl:attribute>
787 <xsl:apply-templates/>
791 <xsl:template match=
"img">
793 <xsl:when test=
"@target">
794 <xsl:element name=
"a">
795 <xsl:attribute name=
"href"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
796 <xsl:attribute name=
"target"><xsl:value-of select=
"@target" /></xsl:attribute>
797 <xsl:element name=
"img">
798 <xsl:if test=
"@class">
799 <xsl:attribute name=
"class"><xsl:value-of select=
"@class" /></xsl:attribute>
801 <xsl:attribute name=
"src"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
802 <xsl:attribute name=
"alt"><xsl:value-of select=
"@alt" /></xsl:attribute>
803 <xsl:if test=
"@width"><xsl:attribute name=
"width"><xsl:value-of select=
"@width" /></xsl:attribute></xsl:if>
804 <xsl:if test=
"@height"><xsl:attribute name=
"height"><xsl:value-of select=
"@height" /></xsl:attribute></xsl:if>
809 <xsl:element name=
"img">
810 <xsl:if test=
"@class">
811 <xsl:attribute name=
"class"><xsl:value-of select=
"@class" /></xsl:attribute>
813 <xsl:attribute name=
"src"><xsl:value-of select=
"iri-to-uri(replace(@src,'%','%25'))" /></xsl:attribute>
814 <xsl:attribute name=
"alt"><xsl:value-of select=
"@alt" /></xsl:attribute>
815 <xsl:if test=
"@width"><xsl:attribute name=
"width"><xsl:value-of select=
"@width" /></xsl:attribute></xsl:if>
816 <xsl:if test=
"@height"><xsl:attribute name=
"height"><xsl:value-of select=
"@height" /></xsl:attribute></xsl:if>
821 <xsl:template match=
"figure[image]">
823 <table class=
"figure">
824 <tr align=
"center"><td>
826 <xsl:element name=
"a">
827 <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>
830 <xsl:apply-templates select=
"image/*" />
832 <tr><td class=
"here-caption">
833 <xsl:apply-templates select=
"caption/*" />
840 <xsl:template match=
"arguments">
841 <xsl:for-each select=
"arg | state">
842 <xsl:if test=
"position() > 1">
843 <xsl:text> </xsl:text>
845 <xsl:apply-templates select=
"." />
848 <xsl:if test=
"arg | state">
849 <xsl:text> </xsl:text>
851 <xsl:apply-templates select=
"sink"/>
855 <xsl:template match=
"arguments/arg">
856 <xsl:if test=
"@identifier">
857 <xsl:call-template name=
"name-to-argument"><xsl:with-param name=
"name"><xsl:value-of select=
"@identifier" /></xsl:with-param></xsl:call-template>
859 <xsl:apply-templates select=
"default"/>
860 <xsl:apply-templates select=
"type"/>
862 <xsl:template match=
"arguments/arg/default">:
<xsl:apply-templates /></xsl:template>
863 <xsl:template match=
"arguments/arg/type"><xsl:text>::
</xsl:text><xsl:apply-templates select=
"*" /></xsl:template>
865 <xsl:template match=
"arguments/state[@identifier]">
866 <xsl:call-template name=
"name-to-state-argument"><xsl:with-param name=
"name"><xsl:value-of select=
"@identifier" /></xsl:with-param></xsl:call-template>
867 <xsl:apply-templates select=
"type"/>
869 <xsl:template match=
"arguments/state[not(@identifier)]">
870 <xsl:apply-templates select=
"type"/>
872 <xsl:template match=
"arguments/state/type"><xsl:text>::
</xsl:text><xsl:apply-templates /></xsl:template>
874 <xsl:template match=
"arguments/sink[@identifier]">
875 <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>
876 <xsl:apply-templates select=
"type"/>
878 <xsl:template match=
"arguments/sink[not(@identifier)]">
879 <xsl:text><></xsl:text>
880 <xsl:apply-templates select=
"type"/>
882 <xsl:template match=
"arguments/sink/type"><xsl:text>::{
</xsl:text><xsl:apply-templates /><xsl:text>}
</xsl:text></xsl:template>
884 <xsl:template match=
"type-templates">
885 <table class=
"type-templates">
886 <xsl:apply-templates />
889 <xsl:template match=
"type-templates/template[@name]">
891 <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>
893 <xsl:apply-templates select=
"description"/>
897 <xsl:template match=
"type-templates/template-state[@name]">
899 <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>
901 <xsl:apply-templates select=
"description"/>
906 <xsl:template match=
"book[namespace and not(extension)]/title/self">
907 <xsl:value-of select=
"../../namespace" />
909 <xsl:template match=
"/book[namespace and not(extension)]/top/p/self">
910 <xsl:call-template name=
"format-namespace-name">
911 <xsl:with-param name=
"name"><xsl:value-of select=
"/book/namespace" /></xsl:with-param>
915 <xsl:template match=
"book[namespace and extension]/title/self">
916 <xsl:value-of select=
"../../extension" />
918 <xsl:template match=
"/book[namespace and extension]/top/p/self">
919 <span class=
"filename"><xsl:value-of select=
"ancestor::book/extension" /></span>
922 <xsl:template match=
"book[namespace and not(extension)]/meta-selflink/self-href">
923 <xsl:call-template name=
"namespace-to-href">
924 <xsl:with-param name=
"name"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
927 <xsl:template match=
"book[namespace and extension]/meta-selflink/self-href">
928 <xsl:call-template name=
"extension-to-href">
929 <xsl:with-param name=
"namespace"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
930 <xsl:with-param name=
"name"><xsl:value-of select=
"../../extension" /></xsl:with-param>
934 <xsl:template match=
"book[namespace and not(extension)]/up-link/parent-namespace">
935 <xsl:variable name=
"ns"><xsl:value-of select=
"../../namespace" /></xsl:variable>
936 <xsl:call-template name=
"name-to-linked-namespace">
937 <xsl:with-param name=
"name"><xsl:value-of select=
"replace($ns, '\.\.[^.]*$', '')" /></xsl:with-param>
940 <xsl:template match=
"book[namespace and extension]/up-link/parent-namespace">
941 <xsl:call-template name=
"name-to-linked-namespace">
942 <xsl:with-param name=
"name"><xsl:value-of select=
"../../namespace" /></xsl:with-param>
946 <xsl:template match=
"type-parameters">
947 <table class=
"type-templates">
948 <xsl:apply-templates />
951 <xsl:template match=
"type-parameters/parameter[@name]">
953 <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>
955 <xsl:apply-templates select=
"description"/>
959 <xsl:template match=
"type-parameters/parameter-state[@name]">
961 <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>
963 <xsl:apply-templates select=
"description"/>
968 <xsl:template name=
"SF-placeholder" >
969 <xsl:comment>PUT-SF-LOGO-HERE
</xsl:comment>
972 <xsl:template match=
"eq"><span class=
"eq"><xsl:apply-templates/></span></xsl:template>
973 <xsl:template match=
"eq//op"><span class=
"rm"><xsl:apply-templates/></span></xsl:template>
974 <xsl:template match=
"eq//rm"><span class=
"rm"><xsl:apply-templates/></span></xsl:template>
975 <xsl:template match=
"eq//text"><span class=
"text"><xsl:apply-templates/></span></xsl:template>
976 <xsl:template match=
"eq//sub"><sub><xsl:apply-templates/></sub></xsl:template>
977 <xsl:template match=
"eq//sup"><sup><xsl:apply-templates/></sup></xsl:template>