~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/erl_docgen/priv/xsl/db_html.xsl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="utf-8"?>
2
 
<!--      
 
2
<!--
3
3
     #
4
4
     # %CopyrightBegin%
5
 
     # 
6
 
     # Copyright Ericsson AB 2009. All Rights Reserved.
7
 
     # 
 
5
     #
 
6
     # Copyright Ericsson AB 2009-2011. All Rights Reserved.
 
7
     #
8
8
     # The contents of this file are subject to the Erlang Public License,
9
9
     # Version 1.1, (the "License"); you may not use this file except in
10
10
     # compliance with the License. You should have received a copy of the
11
11
     # Erlang Public License along with this software. If not, it can be
12
12
     # retrieved online at http://www.erlang.org/.
13
 
     # 
 
13
     #
14
14
     # Software distributed under the License is distributed on an "AS IS"
15
15
     # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
16
16
     # the License for the specific language governing rights and limitations
17
17
     # under the License.
18
 
     # 
 
18
     #
19
19
     # %CopyrightEnd%
20
 
     
 
20
 
21
21
     -->
22
22
 
23
23
<xsl:stylesheet version="1.0"
24
24
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25
 
  xmlns:fn="http://www.w3.org/2005/02/xpath-functions"> 
 
25
  xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
26
26
 
27
27
  <xsl:include href="db_html_params.xsl"/>
28
28
 
 
29
  <!-- Start of Dialyzer type/spec tags.
 
30
       See also the template matching "name" and the template "menu.funcs"
 
31
  -->
 
32
 
 
33
  <xsl:param name="specs_file" select="''"/>
 
34
  <xsl:variable name="i" select="document($specs_file)"></xsl:variable>
 
35
 
 
36
  <xsl:param name="mod2app_file" select="''"/>
 
37
  <xsl:variable name="m2a" select="document($mod2app_file)"></xsl:variable>
 
38
  <xsl:key name="mod2app" match="module" use="@name"/>
 
39
 
 
40
  <xsl:template name="err">
 
41
    <xsl:param name="m"/>
 
42
    <xsl:param name="n"/>
 
43
    <xsl:param name="a"/>
 
44
    <xsl:param name="s"/>
 
45
    <xsl:message terminate="yes">
 
46
  Error <xsl:if test="$m != ''"><xsl:value-of select ="$m"/>:</xsl:if>
 
47
         <xsl:value-of
 
48
                   select="$n"/>/<xsl:value-of
 
49
                   select="$a"/>: <xsl:value-of select="$s"/>
 
50
    </xsl:message>
 
51
  </xsl:template>
 
52
 
 
53
  <xsl:template name="spec_name">
 
54
    <xsl:variable name="curModule" select="ancestor::erlref/module"/>
 
55
    <xsl:variable name="mod" select="@mod"/>
 
56
    <xsl:variable name="name" select="@name"/>
 
57
    <xsl:variable name="arity" select="@arity"/>
 
58
    <xsl:variable name="clause" select="@clause"/>
 
59
    <xsl:variable name="spec0" select=
 
60
        "$i/specs/module[@name=$curModule]/spec
 
61
             [name=$name and arity=$arity
 
62
              and (string-length($mod) = 0 or module = $mod)]"/>
 
63
    <xsl:variable name="spec" select="$spec0[string-length($clause) = 0
 
64
                                             or position() = $clause]"/>
 
65
    <xsl:if test="count($spec) = 0">
 
66
      <xsl:call-template name="err">
 
67
        <xsl:with-param name="m" select="$mod"/>
 
68
        <xsl:with-param name="n" select="$name"/>
 
69
        <xsl:with-param name="a" select="$arity"/>
 
70
        <xsl:with-param name="s">unknown spec</xsl:with-param>
 
71
      </xsl:call-template>
 
72
    </xsl:if>
 
73
 
 
74
    <xsl:variable name="arity_clause">
 
75
      <xsl:choose>
 
76
        <xsl:when test="string-length(@clause) > 0">
 
77
          <xsl:value-of select="@arity"/>/<xsl:value-of select="@clause"/>
 
78
        </xsl:when>
 
79
        <xsl:otherwise>
 
80
          <xsl:value-of select="@arity"/>
 
81
        </xsl:otherwise>
 
82
      </xsl:choose>
 
83
    </xsl:variable>
 
84
 
 
85
    <xsl:choose>
 
86
      <xsl:when test="ancestor::cref">
 
87
        <xsl:message terminate="yes">
 
88
          Error: did not expect a 'name' tag with name/arity attributes here!
 
89
        </xsl:message>
 
90
      </xsl:when>
 
91
      <xsl:when test="ancestor::erlref">
 
92
        <a name="{$name}-{$arity_clause}"></a>
 
93
        <xsl:choose>
 
94
          <xsl:when test="string(@with_guards) = 'no'">
 
95
            <xsl:apply-templates select="$spec/contract/clause/head"/>
 
96
          </xsl:when>
 
97
          <xsl:otherwise>
 
98
            <xsl:call-template name="contract">
 
99
              <xsl:with-param name="contract" select="$spec/contract"/>
 
100
            </xsl:call-template>
 
101
          </xsl:otherwise>
 
102
        </xsl:choose>
 
103
      </xsl:when>
 
104
    </xsl:choose>
 
105
  </xsl:template>
 
106
 
 
107
  <xsl:template name="contract">
 
108
    <xsl:param name="contract"/>
 
109
    <xsl:call-template name="clause">
 
110
      <xsl:with-param name="clause" select="$contract/clause"/>
 
111
    </xsl:call-template>
 
112
  </xsl:template>
 
113
 
 
114
  <xsl:template name="clause">
 
115
    <xsl:param name="clause"/>
 
116
    <xsl:variable name="type_desc" select="../type_desc"/>
 
117
    <xsl:for-each select="$clause">
 
118
      <xsl:apply-templates select="head"/>
 
119
      <xsl:if test="count(guard) > 0">
 
120
        <xsl:call-template name="guard">
 
121
          <xsl:with-param name="guard" select="guard"/>
 
122
          <xsl:with-param name="type_desc" select="$type_desc"/>
 
123
        </xsl:call-template>
 
124
      </xsl:if>
 
125
    </xsl:for-each>
 
126
  </xsl:template>
 
127
 
 
128
  <xsl:template match="head">
 
129
    <span class="bold_code">
 
130
      <xsl:apply-templates/>
 
131
    </span>
 
132
    <br/>
 
133
  </xsl:template>
 
134
 
 
135
  <xsl:template name="guard">
 
136
    <xsl:param name="guard"/>
 
137
    <xsl:param name="type_desc"/>
 
138
    <div class="REFBODY"><p>Types:</p>
 
139
      <xsl:call-template name="subtype">
 
140
        <xsl:with-param name="subtype" select="$guard/subtype"/>
 
141
        <xsl:with-param name="type_desc" select="$type_desc"/>
 
142
      </xsl:call-template>
 
143
    </div>
 
144
  </xsl:template>
 
145
 
 
146
  <xsl:template name="subtype">
 
147
    <xsl:param name="subtype"/>
 
148
    <xsl:param name="type_desc"/>
 
149
    <xsl:for-each select="$subtype">
 
150
      <xsl:variable name="tname" select="typename"/>
 
151
      <xsl:variable name="tdesc" select="$type_desc[@name = $tname]"/>
 
152
      <div class="REFTYPES">
 
153
        <span class="bold_code">
 
154
          <xsl:apply-templates select="string"/>
 
155
        </span>
 
156
      </div>
 
157
      <xsl:apply-templates select="$type_desc[@name = $tname]"/>
 
158
    </xsl:for-each>
 
159
  </xsl:template>
 
160
 
 
161
  <!-- Note: <type_desc> has not been implemented for data types. -->
 
162
 
 
163
  <!-- Similar to <d> -->
 
164
  <xsl:template match="type_desc">
 
165
    <div class="REFBODY">
 
166
      <xsl:apply-templates/>
 
167
    </div>
 
168
  </xsl:template>
 
169
 
 
170
  <!-- This is for debugging. All modules! -->
 
171
  <xsl:template match="all_etypes">
 
172
    <xsl:for-each select= "$i//type">
 
173
      <pre>
 
174
        <span class="bold_code">
 
175
          <xsl:apply-templates select="typedecl"/>
 
176
        </span><xsl:text>
 
177
</xsl:text>
 
178
      </pre>
 
179
    </xsl:for-each>
 
180
  </xsl:template>
 
181
 
 
182
  <!-- Datatypes -->
 
183
  <xsl:template match="datatypes">
 
184
    <h3>
 
185
      <xsl:text>DATA TYPES</xsl:text>
 
186
    </h3>
 
187
    <xsl:apply-templates/>
 
188
  </xsl:template>
 
189
 
 
190
  <!-- Datatype -->
 
191
  <xsl:template match="datatype">
 
192
    <p><xsl:apply-templates select="name"/></p>
 
193
    <xsl:apply-templates select="desc"/>
 
194
  </xsl:template>
 
195
 
 
196
  <xsl:template match="typehead">
 
197
    <span class="bold_code">
 
198
      <xsl:apply-templates/>
 
199
    </span><br/>
 
200
  </xsl:template>
 
201
 
 
202
  <!-- local_defs -->
 
203
  <xsl:template match="local_defs">
 
204
    <div class="REFBODY">
 
205
      <xsl:apply-templates>
 
206
      </xsl:apply-templates>
 
207
    </div>
 
208
  </xsl:template>
 
209
 
 
210
  <xsl:template match="local_def">
 
211
    <div class="REFTYPES">
 
212
      <span class="bold_code">
 
213
        <xsl:apply-templates/>
 
214
      </span>
 
215
    </div>
 
216
  </xsl:template>
 
217
 
 
218
  <xsl:template name="type_name">
 
219
    <xsl:variable name="curModule" select="ancestor::erlref/module"/>
 
220
    <xsl:variable name="mod" select="@mod"/>
 
221
    <xsl:variable name="name" select="@name"/>
 
222
    <xsl:variable name="n_vars">
 
223
      <xsl:choose>
 
224
        <xsl:when test="string-length(@n_vars) > 0">
 
225
          <xsl:value-of select="@n_vars"/>
 
226
        </xsl:when>
 
227
        <xsl:otherwise>
 
228
          <xsl:value-of select="0"/>
 
229
        </xsl:otherwise>
 
230
      </xsl:choose>
 
231
    </xsl:variable>
 
232
 
 
233
    <xsl:choose>
 
234
      <xsl:when test="string-length($name) > 0">
 
235
        <xsl:variable name="type" select=
 
236
            "$i/specs/module[@name=$curModule]/type
 
237
                 [name=$name and n_vars=$n_vars
 
238
                  and (string-length($mod) = 0 or module = $mod)]"/>
 
239
 
 
240
        <xsl:if test="count($type) != 1">
 
241
          <xsl:call-template name="err">
 
242
            <xsl:with-param name="m" select="$mod"/>
 
243
            <xsl:with-param name="n" select="$name"/>
 
244
            <xsl:with-param name="a" select="$n_vars"/>
 
245
            <xsl:with-param name="s">unknown type</xsl:with-param>
 
246
          </xsl:call-template>
 
247
        </xsl:if>
 
248
        <xsl:apply-templates select="$type/typedecl"/>
 
249
      </xsl:when>
 
250
      <xsl:otherwise>
 
251
        <span class="bold_code">
 
252
          <xsl:value-of select="."/>
 
253
        </span>
 
254
      </xsl:otherwise>
 
255
    </xsl:choose>
 
256
  </xsl:template>
 
257
 
 
258
  <!-- Used both in <datatype> and in <func>! -->
 
259
  <xsl:template match="anno">
 
260
    <xsl:variable name="curModule" select="ancestor::erlref/module"/>
 
261
    <xsl:variable name="anno" select="normalize-space(text())"/>
 
262
    <xsl:variable name="namespec"
 
263
                  select="ancestor::desc/preceding-sibling::name"/>
 
264
    <xsl:if test="count($namespec) = 0 and string-length($specs_file) > 0">
 
265
      <xsl:call-template name="err">
 
266
        <xsl:with-param name="s">cannot find 'name' (<xsl:value-of select="$anno"/>)
 
267
        </xsl:with-param>
 
268
      </xsl:call-template>
 
269
    </xsl:if>
 
270
 
 
271
    <xsl:variable name="mod" select="$namespec/@mod"/>
 
272
    <xsl:variable name="name" select="$namespec/@name"/>
 
273
    <xsl:variable name="arity" select="$namespec/@arity"/>
 
274
    <xsl:variable name="clause" select="$namespec/@clause"/>
 
275
    <xsl:variable name="tmp_n_vars" select="$namespec/@n_vars"/>
 
276
    <xsl:variable name="n_vars">
 
277
      <xsl:choose>
 
278
        <xsl:when test="string-length($tmp_n_vars) > 0">
 
279
          <xsl:value-of select="$tmp_n_vars"/>
 
280
        </xsl:when>
 
281
        <xsl:otherwise>
 
282
          <xsl:value-of select="0"/>
 
283
        </xsl:otherwise>
 
284
      </xsl:choose>
 
285
    </xsl:variable>
 
286
    <xsl:variable name="spec0" select=
 
287
        "$i/specs/module[@name=$curModule]/spec
 
288
             [name=$name and arity=$arity
 
289
              and (string-length($mod) = 0 or module = $mod)]"/>
 
290
    <xsl:variable name="spec_annos" select=
 
291
         "$spec0[string-length($clause) = 0
 
292
                 or position() = $clause]/anno[.=$anno]"/>
 
293
    <xsl:variable name="type_annos" select=
 
294
        "$i/specs/module[@name=$curModule]/type
 
295
             [name=$name and n_vars=$n_vars
 
296
              and (string-length($mod) = 0 or module = $mod)]/anno[.=$anno]"/>
 
297
 
 
298
    <xsl:if test="count($spec_annos) = 0
 
299
                  and count($type_annos) = 0
 
300
                  and string-length($specs_file) > 0">
 
301
      <xsl:variable name="n">
 
302
        <xsl:choose>
 
303
          <xsl:when test="string-length($arity) = 0">
 
304
            <xsl:value-of select="$n_vars"/>
 
305
          </xsl:when>
 
306
          <xsl:otherwise>
 
307
            <xsl:value-of select="$arity"/>
 
308
          </xsl:otherwise>
 
309
        </xsl:choose>
 
310
      </xsl:variable>
 
311
      <xsl:call-template name="err">
 
312
        <xsl:with-param name="m" select="$mod"/>
 
313
        <xsl:with-param name="n" select="$name"/>
 
314
        <xsl:with-param name="a" select="$n"/>
 
315
        <xsl:with-param name="s">unknown annotation <xsl:value-of select="$anno"/>
 
316
        </xsl:with-param>
 
317
      </xsl:call-template>
 
318
    </xsl:if>
 
319
    <xsl:value-of select="$anno"/>
 
320
  </xsl:template>
 
321
 
 
322
  <!-- Used for indentation of formatted types and specs -->
 
323
  <xsl:template match="nbsp">
 
324
    <xsl:text>&#160;</xsl:text>
 
325
  </xsl:template>
 
326
 
 
327
  <!-- End of Dialyzer type/spec tags -->
 
328
 
29
329
  <!-- Page layout -->
30
330
  <xsl:template name="pagelayout">
31
331
    <xsl:param name="chapnum"/>
36
336
        <title>Erlang -- <xsl:value-of select="header/title"/></title>
37
337
      </head>
38
338
      <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000">
39
 
        
 
339
 
40
340
        <div id="container">
41
341
          <script id="js" type="text/javascript" language="JavaScript" src="{$topdocdir}/js/flipmenu/flipmenu.js"/>
42
342
          <script id="js2" type="text/javascript" src="{$topdocdir}/js/erlresolvelinks.js"></script>
 
343
          <script language="JavaScript" type="text/javascript">
 
344
            <xsl:text disable-output-escaping="yes"><![CDATA[
 
345
            <!--
 
346
              function getWinHeight() {
 
347
                var myHeight = 0;
 
348
                if( typeof( window.innerHeight ) == 'number' ) {
 
349
                  //Non-IE
 
350
                  myHeight = window.innerHeight;
 
351
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
 
352
                                                         document.documentElement.clientHeight ) ) {
 
353
                  //IE 6+ in 'standards compliant mode'
 
354
                  myHeight = document.documentElement.clientHeight;
 
355
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
 
356
                  //IE 4 compatible
 
357
                  myHeight = document.body.clientHeight;
 
358
                }
 
359
                return myHeight;
 
360
              }
 
361
 
 
362
              function setscrollpos() {
 
363
                var objf=document.getElementById('loadscrollpos');
 
364
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
 
365
              }
 
366
 
 
367
              function addEvent(obj, evType, fn){
 
368
                if (obj.addEventListener){
 
369
                obj.addEventListener(evType, fn, true);
 
370
                return true;
 
371
              } else if (obj.attachEvent){
 
372
                var r = obj.attachEvent("on"+evType, fn);
 
373
                return r;
 
374
              } else {
 
375
                return false;
 
376
              }
 
377
             }
 
378
 
 
379
             addEvent(window, 'load', setscrollpos);
 
380
 
 
381
             //-->]]></xsl:text>
 
382
          </script>
43
383
          <!-- Generate menu -->
44
384
          <xsl:call-template name="menu">
45
385
            <xsl:with-param name="chapnum" select="$chapnum"/>
46
386
            <xsl:with-param name="curModule" select="$curModule"/>
47
387
          </xsl:call-template>
48
 
   
 
388
 
49
389
          <div id="content">
50
390
            <div class="innertube">
51
391
 
61
401
                <xsl:value-of select="$copyright"/>
62
402
                <xsl:value-of select="/book/header/copyright/year[1]"/>
63
403
                <xsl:text>-</xsl:text>
64
 
                <xsl:value-of select="substring-after(substring-after($gendate, ' '), ' ')"/>
 
404
                <xsl:value-of select="substring-after(normalize-space(substring-after($gendate, ' ')), ' ')"/>
65
405
                <xsl:text> </xsl:text>
66
406
                <xsl:value-of select="/book/header/copyright/holder"/>
67
407
              </p>
84
424
    <xsl:if test="$lname = 'releasenotes'">
85
425
      <!-- .../part -->
86
426
      <xsl:call-template name="releasenotes.content" />
87
 
    </xsl:if> 
 
427
    </xsl:if>
88
428
    <xsl:if test="$lname = 'part'">
89
429
      <!-- .../part -->
90
430
      <xsl:call-template name="part.content" />
91
 
    </xsl:if>    
 
431
    </xsl:if>
92
432
    <xsl:if test="$lname = 'chapter'">
93
433
      <!-- .../part/chapter -->
94
434
      <xsl:call-template name="chapter.content">
95
435
        <xsl:with-param name="chapnum" select="$chapnum"/>
96
436
      </xsl:call-template>
97
 
    </xsl:if>  
 
437
    </xsl:if>
98
438
    <xsl:if test="$lname = 'application'">
99
439
      <!-- .../application -->
100
440
      <xsl:call-template name="app.content" />
138
478
    <small>
139
479
      <xsl:if test="boolean(/book/parts/part)">
140
480
        <a href="users_guide.html">User's Guide</a><br/>
141
 
      </xsl:if> 
 
481
      </xsl:if>
142
482
      <xsl:if test="boolean(/book/applications)">
143
483
        <a href="index.html">Reference Manual</a><br/>
144
 
      </xsl:if> 
 
484
      </xsl:if>
145
485
      <xsl:if test="boolean(/book/releasenotes)">
146
486
        <a href="release_notes.html">Release Notes</a><br/>
147
 
      </xsl:if> 
 
487
      </xsl:if>
148
488
      <a href="{$pdfdir}/{$appname}-{$appver}.pdf">PDF</a><br/>
149
489
      <a href="{$topdocdir}/index.html">Top</a>
150
490
    </small>
151
491
  </xsl:template>
152
 
        
 
492
 
153
493
  <xsl:template name="menu_middle">
154
494
    <!-- small>
155
495
      <xsl:choose>
156
496
        <xsl:when test="ancestor::parts">
157
497
          <a href="users_guide_bibliography.html">Bibliography</a><br/>
158
498
          <a href="users_guide_glossary.html">Glossary</a><br/>
159
 
        </xsl:when> 
160
 
        <xsl:when test="ancestor::applications"> 
 
499
        </xsl:when>
 
500
        <xsl:when test="ancestor::applications">
161
501
          <a href="ref_man_bibliography.html">Bibliography</a><br/>
162
502
          <a href="ref_man_glossary.html">Glossary</a><br/>
163
 
        </xsl:when>        
 
503
        </xsl:when>
164
504
      </xsl:choose>
165
505
    </small -->
166
506
    <br/>
167
507
 
168
508
    <a href="javascript:openAllFlips()">Expand All</a><br/>
169
509
    <a href="javascript:closeAllFlips()">Contract All</a>
170
 
  </xsl:template>        
171
 
  
 
510
  </xsl:template>
 
511
 
172
512
 
173
513
  <!-- Book -->
174
514
  <xsl:template match="/book">
203
543
 
204
544
  <!-- Chapter/Section -->
205
545
  <xsl:template match="chapter/section">
206
 
    <xsl:param name="chapnum"/>  
 
546
    <xsl:param name="chapnum"/>
207
547
    <h3>
208
548
      <a name="{generate-id(title)}">
209
549
        <xsl:value-of select="$chapnum"/>.<xsl:number/>&#160;
216
556
    </xsl:apply-templates>
217
557
  </xsl:template>
218
558
 
219
 
  <!-- Chapter/Subsection -->
220
 
  <xsl:template match="chapter/section/section">
 
559
  <!-- Subsections lvl 3 and ... -->
 
560
  <xsl:template match="section/section">
221
561
    <xsl:param name="chapnum"/>
222
562
    <xsl:param name="sectnum"/>
223
563
    <h4>
229
569
    </xsl:apply-templates>
230
570
  </xsl:template>
231
571
 
232
 
 
233
 
 
234
572
  <!-- *ref/Section -->
235
573
  <xsl:template match="erlref/section|cref/section|comref/section|fileref/section|appref/section">
236
574
    <xsl:param name="chapnum"/>
262
600
 
263
601
 
264
602
  <!-- Lists -->
265
 
  
 
603
 
266
604
  <xsl:template match="list">
267
605
    <xsl:param name="chapnum"/>
268
606
    <ul>
290
628
      </xsl:apply-templates>
291
629
    </dl>
292
630
  </xsl:template>
293
 
  
 
631
 
294
632
  <xsl:template match="taglist/tag">
295
633
    <xsl:param name="chapnum"/>
296
634
    <dt>
337
675
          </xsl:apply-templates>
338
676
        </p>
339
677
      </div>
340
 
    </div>          
 
678
    </div>
341
679
  </xsl:template>
342
680
 
343
681
 <!-- Paragraph -->
362
700
  </xsl:template>
363
701
 
364
702
  <xsl:template match="em">
365
 
    <strong><xsl:apply-templates/></strong> 
 
703
    <strong><xsl:apply-templates/></strong>
366
704
  </xsl:template>
367
705
 
368
706
  <!-- Code -->
467
805
  <!-- Part -->
468
806
  <xsl:template match="part">
469
807
    <!-- Generate Glossary for Users Guide -->
470
 
    <!--xsl:call-template name="glossary"> 
 
808
    <!--xsl:call-template name="glossary">
471
809
    <xsl:with-param name="type">users_guide</xsl:with-param>
472
810
    </xsl:call-template-->
473
811
 
490
828
 
491
829
    <center><h4>Version <xsl:value-of select="$appver"/></h4></center>
492
830
    <center><h4><xsl:value-of select="$gendate"/></h4></center>
493
 
    
 
831
 
494
832
    <xsl:apply-templates select="chapter"/>
495
 
          
 
833
 
496
834
  </xsl:template>
497
835
 
498
836
  <!-- Menu.ug -->
525
863
          </xsl:call-template>
526
864
        </ul>
527
865
      </div>
528
 
    </div>            
 
866
    </div>
529
867
  </xsl:template>
530
 
  
531
 
  
 
868
 
 
869
 
532
870
  <xsl:template name="menu.chapter">
533
871
    <xsl:param name="entries"/>
534
872
    <xsl:param name="chapnum"/>
543
881
          <xsl:otherwise>false</xsl:otherwise>
544
882
        </xsl:choose>
545
883
      </xsl:variable>
546
 
      <li title="{header/title}" expanded="{$expanded}">
 
884
      <xsl:variable name="loadscrollpos">
 
885
        <xsl:choose>
 
886
          <xsl:when test="$chapnum = $curchapnum">loadscrollpos</xsl:when>
 
887
          <xsl:otherwise>no</xsl:otherwise>
 
888
        </xsl:choose>
 
889
      </xsl:variable>
 
890
      <li id="{$loadscrollpos}" title="{header/title}" expanded="{$expanded}">
547
891
        <xsl:value-of select="header/title"/>
548
892
        <ul>
549
893
          <li>
550
894
            <a href="{$chapter_file}.html">
551
895
              Top of chapter
552
896
            </a>
553
 
          </li>         
 
897
          </li>
554
898
          <xsl:call-template name="menu.section">
555
899
            <xsl:with-param name="entries"
556
900
              select="section[title]"/>
577
921
  <!-- Chapter (if top tag)-->
578
922
  <xsl:template match="/chapter">
579
923
 
580
 
    <xsl:document href="{substring-before(header/file, '.xml')}.html" method="html" encoding="UTF-8" indent="yes" 
 
924
    <xsl:document href="{substring-before(header/file, '.xml')}.html" method="html" encoding="UTF-8" indent="yes"
581
925
      doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN">
582
926
 
583
927
      <xsl:call-template name="pagelayout">
589
933
  <!-- Chapter -->
590
934
  <xsl:template match="chapter">
591
935
 
592
 
    <xsl:document href="{substring-before(header/file, '.xml')}.html" method="html" encoding="UTF-8" indent="yes" 
 
936
    <xsl:document href="{substring-before(header/file, '.xml')}.html" method="html" encoding="UTF-8" indent="yes"
593
937
      doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN">
594
938
 
595
939
      <xsl:call-template name="pagelayout">
624
968
  <xsl:template match="application">
625
969
 
626
970
    <!-- Generate Glossary for Ref. Manual -->
627
 
    <!--xsl:call-template name="glossary"> 
 
971
    <!--xsl:call-template name="glossary">
628
972
      <xsl:with-param name="type">ref_man</xsl:with-param>
629
973
    </xsl:call-template-->
630
974
 
632
976
    <!--xsl:call-template name="bibliography">
633
977
      <xsl:with-param name="type">ref_man</xsl:with-param>
634
978
    </xsl:call-template-->
635
 
    
 
979
 
636
980
 
637
981
    <xsl:document href="{$outdir}/index.html" method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN">
638
982
 
649
993
 
650
994
    <center><h4>Version <xsl:value-of select="$appver"/></h4></center>
651
995
    <center><h4><xsl:value-of select="$gendate"/></h4></center>
652
 
    
 
996
 
653
997
    <xsl:apply-templates select="erlref|cref|comref|fileref|appref"/>
654
 
          
 
998
 
655
999
  </xsl:template>
656
1000
 
657
1001
  <!-- Menu.ref -->
658
1002
  <xsl:template name="menu.ref">
659
 
    <xsl:param name="$curModule"/>
 
1003
    <xsl:param name="curModule"/>
660
1004
    <div id="leftnav">
661
1005
      <div class="innertube">
662
1006
 
684
1028
          </xsl:call-template>
685
1029
        </ul>
686
1030
      </div>
687
 
    </div>            
 
1031
    </div>
688
1032
  </xsl:template>
689
 
  
690
 
  
 
1033
 
 
1034
 
691
1035
  <xsl:template name="menu.ref2">
692
1036
    <xsl:param name="entries"/>
693
1037
    <!--xsl:param name="genFuncMenu"/-->
694
1038
    <xsl:param name="curModule"/>
695
1039
    <xsl:for-each select="$entries">
696
 
      
 
1040
 
697
1041
      <xsl:variable name="cval">
698
1042
        <xsl:choose>
699
1043
          <xsl:when test="local-name() = 'erlref'">
721
1065
          <xsl:when test="local-name() = 'fileref'">false</xsl:when>
722
1066
          <xsl:when test="descendant::funcs">true</xsl:when>
723
1067
          <xsl:otherwise>false</xsl:otherwise>
724
 
        </xsl:choose>        
 
1068
        </xsl:choose>
725
1069
      </xsl:variable>
726
 
      
 
1070
 
727
1071
      <xsl:variable name="expanded">
728
1072
        <xsl:choose>
729
1073
          <xsl:when test="$curModule = $cval">true</xsl:when>
731
1075
        </xsl:choose>
732
1076
      </xsl:variable>
733
1077
 
 
1078
      <xsl:variable name="loadscrollpos">
 
1079
        <xsl:choose>
 
1080
          <xsl:when test="$curModule = $cval">loadscrollpos</xsl:when>
 
1081
          <xsl:otherwise>no</xsl:otherwise>
 
1082
        </xsl:choose>
 
1083
      </xsl:variable>
 
1084
 
734
1085
      <xsl:variable name="link_cval"><xsl:value-of select="translate($cval, '&#173;', '')"/></xsl:variable>
735
1086
 
736
1087
      <xsl:choose>
737
1088
        <xsl:when test="$genFuncMenu = 'true'">
738
1089
 
739
 
          <li title="{$cval} " expanded="{$expanded}">
 
1090
          <li id="{$loadscrollpos}" title="{$cval} " expanded="{$expanded}">
740
1091
            <xsl:value-of select="$cval"/>
741
1092
            <ul>
742
1093
              <li>
743
1094
                <a href="{$link_cval}.html">
744
1095
                  Top of manual page
745
1096
                </a>
746
 
              </li>         
 
1097
              </li>
747
1098
              <xsl:call-template name="menu.funcs">
748
1099
                <xsl:with-param name="entries"
749
1100
                  select="funcs/func/name"/>
770
1121
            </xsl:otherwise>
771
1122
          </xsl:choose>
772
1123
        </xsl:otherwise>
773
 
      </xsl:choose>        
 
1124
      </xsl:choose>
774
1125
    </xsl:for-each>
775
1126
  </xsl:template>
776
1127
 
778
1129
  <xsl:template name="menu.funcs">
779
1130
    <xsl:param name="entries"/>
780
1131
    <xsl:param name="basename"/>
781
 
    
 
1132
 
782
1133
    <xsl:for-each select="$entries">
783
1134
 
784
1135
      <xsl:choose>
787
1138
          <xsl:choose>
788
1139
            <xsl:when test="string-length($fname) > 0">
789
1140
              <li title="{$fname}">
790
 
                <a href="{$basename}.html#{$fname}">  
791
 
                <xsl:value-of select="$fname"/>()
792
 
              </a>
793
 
            </li>           
794
 
          </xsl:when>
795
 
          <xsl:otherwise>
796
 
            <li title="{name/nametext}">
797
 
              <a href="{$basename}.html#{name/nametext}">  
798
 
                <xsl:value-of select="nametext"/>()
799
 
              </a> 
800
 
            </li>    
801
 
          </xsl:otherwise>
802
 
        </xsl:choose> 
803
 
      </xsl:when>
804
 
      
805
 
      <xsl:when test="ancestor::erlref">
806
 
 
807
 
        <xsl:variable name="tmpstring">
808
 
          <xsl:value-of select="substring-before(substring-after(., '('), '->')"/>
809
 
        </xsl:variable>     
810
 
 
811
 
        <xsl:variable name="ustring">
812
 
          <xsl:choose>
813
 
            <xsl:when test="string-length($tmpstring) > 0">
814
 
              <xsl:call-template name="remove-paren">
815
 
                <xsl:with-param name="string" select="$tmpstring"/>
816
 
              </xsl:call-template>            
 
1141
                <a href="{$basename}.html#{$fname}">
 
1142
                  <xsl:value-of select="$fname"/>()
 
1143
                </a>
 
1144
              </li>
817
1145
            </xsl:when>
818
1146
            <xsl:otherwise>
819
 
              <xsl:call-template name="remove-paren">
820
 
                <xsl:with-param name="string" select="substring-after(., '(')"/>
821
 
              </xsl:call-template>                      
 
1147
              <li title="{name/nametext}">
 
1148
                <a href="{$basename}.html#{name/nametext}">
 
1149
                  <xsl:value-of select="nametext"/>()
 
1150
                </a>
 
1151
              </li>
822
1152
            </xsl:otherwise>
823
1153
          </xsl:choose>
824
 
        </xsl:variable>      
825
 
 
826
 
        <xsl:variable name="arity">
827
 
          <xsl:call-template name="calc-arity">
828
 
            <xsl:with-param name="string" select="substring-before($ustring, ')')"/>
829
 
            <xsl:with-param name="no-of-pars" select="0"/> 
830
 
          </xsl:call-template>
831
 
        </xsl:variable> 
832
 
        <xsl:variable name="fname">
833
 
          <xsl:value-of select="substring-before(., '(')"/>
834
 
        </xsl:variable>
835
 
        <li title="{$fname}-{$arity}">
836
 
          <a href="{$basename}.html#{$fname}-{$arity}">                                             
837
 
            <xsl:value-of select="$fname"/>/<xsl:value-of select="$arity"/>
838
 
          </a>
839
 
        </li>        
840
 
      </xsl:when>
841
 
    </xsl:choose>
 
1154
        </xsl:when>
 
1155
 
 
1156
        <xsl:when test="ancestor::erlref">
 
1157
 
 
1158
          <xsl:variable name="tmpstring">
 
1159
            <xsl:value-of select="substring-before(substring-after(., '('), '->')"/>
 
1160
          </xsl:variable>
 
1161
 
 
1162
          <xsl:variable name="ustring">
 
1163
            <xsl:choose>
 
1164
              <xsl:when test="string-length($tmpstring) > 0">
 
1165
                <xsl:call-template name="remove-paren">
 
1166
                  <xsl:with-param name="string" select="$tmpstring"/>
 
1167
                </xsl:call-template>
 
1168
              </xsl:when>
 
1169
              <xsl:otherwise>
 
1170
                <xsl:call-template name="remove-paren">
 
1171
                  <xsl:with-param name="string" select="substring-after(., '(')"/>
 
1172
                </xsl:call-template>
 
1173
              </xsl:otherwise>
 
1174
            </xsl:choose>
 
1175
          </xsl:variable>
 
1176
 
 
1177
          <xsl:variable name="arity">
 
1178
            <xsl:choose>
 
1179
              <xsl:when test="string-length(@arity) > 0">
 
1180
                <!-- Dialyzer spec -->
 
1181
                <xsl:choose>
 
1182
                  <xsl:when test="string-length(@clause) > 0">
 
1183
                    <xsl:value-of select="@arity"/>/<xsl:value-of select="@clause"/>
 
1184
                  </xsl:when>
 
1185
                  <xsl:otherwise>
 
1186
                    <xsl:value-of select="@arity"/>
 
1187
                  </xsl:otherwise>
 
1188
                </xsl:choose>
 
1189
              </xsl:when>
 
1190
              <xsl:otherwise>
 
1191
                <xsl:call-template name="calc-arity">
 
1192
                  <xsl:with-param name="string" select="substring-before($ustring, ')')"/>
 
1193
                  <xsl:with-param name="no-of-pars" select="0"/>
 
1194
                </xsl:call-template>
 
1195
              </xsl:otherwise>
 
1196
            </xsl:choose>
 
1197
          </xsl:variable>
 
1198
 
 
1199
          <xsl:variable name="fname">
 
1200
            <xsl:choose>
 
1201
              <xsl:when test="string-length(@name) > 0">
 
1202
                <!-- Dialyzer spec -->
 
1203
                <xsl:value-of select="@name"/>
 
1204
              </xsl:when>
 
1205
              <xsl:otherwise>
 
1206
                <xsl:variable name="fname1">
 
1207
                  <xsl:value-of select="substring-before(., '(')"/>
 
1208
                </xsl:variable>
 
1209
                <xsl:variable name="fname2">
 
1210
                  <xsl:value-of select="substring-after($fname1, 'erlang:')"/>
 
1211
                </xsl:variable>
 
1212
                <xsl:choose>
 
1213
                  <xsl:when test="string-length($fname2) > 0">
 
1214
                    <xsl:value-of select="$fname2"/>
 
1215
                  </xsl:when>
 
1216
                  <xsl:otherwise>
 
1217
                    <xsl:value-of select="$fname1"/>
 
1218
                  </xsl:otherwise>
 
1219
                </xsl:choose>
 
1220
              </xsl:otherwise>
 
1221
            </xsl:choose>
 
1222
          </xsl:variable>
 
1223
 
 
1224
          <li title="{$fname}-{$arity}">
 
1225
            <a href="{$basename}.html#{$fname}-{$arity}">
 
1226
              <xsl:value-of select="$fname"/>/<xsl:value-of select="$arity"/>
 
1227
            </a>
 
1228
          </li>
 
1229
        </xsl:when>
 
1230
      </xsl:choose>
842
1231
 
843
1232
    </xsl:for-each>
844
1233
  </xsl:template>
1065
1454
 
1066
1455
  <!-- Funcs -->
1067
1456
  <xsl:template match="funcs">
 
1457
    <xsl:param name="partnum"/>
1068
1458
 
1069
1459
    <h3>
1070
1460
      <xsl:text>EXPORTS</xsl:text>
1079
1469
  <!-- Func -->
1080
1470
  <xsl:template match="func">
1081
1471
    <xsl:param name="partnum"/>
1082
 
   
 
1472
 
1083
1473
    <p><xsl:apply-templates select="name"/></p>
1084
1474
 
1085
1475
    <xsl:apply-templates select="fsummary|type|desc">
1088
1478
 
1089
1479
  </xsl:template>
1090
1480
 
 
1481
 
1091
1482
  <xsl:template match="name">
 
1483
    <xsl:choose>
 
1484
      <!-- @arity is mandatory when referring to a specification -->
 
1485
      <xsl:when test="string-length(@arity) > 0">
 
1486
        <xsl:call-template name="spec_name"/>
 
1487
      </xsl:when>
 
1488
      <xsl:when test="ancestor::datatype">
 
1489
        <xsl:call-template name="type_name"/>
 
1490
      </xsl:when>
 
1491
      <xsl:otherwise>
 
1492
        <xsl:call-template name="name"/>
 
1493
      </xsl:otherwise>
 
1494
    </xsl:choose>
 
1495
  </xsl:template>
 
1496
 
 
1497
  <xsl:template name="name">
1092
1498
 
1093
1499
    <xsl:variable name="tmpstring">
1094
1500
      <xsl:value-of select="substring-before(substring-after(., '('), '->')"/>
1095
 
    </xsl:variable>     
 
1501
    </xsl:variable>
1096
1502
 
1097
1503
    <xsl:variable name="ustring">
1098
1504
      <xsl:choose>
1099
1505
        <xsl:when test="string-length($tmpstring) > 0">
1100
1506
          <xsl:call-template name="remove-paren">
1101
1507
            <xsl:with-param name="string" select="$tmpstring"/>
1102
 
          </xsl:call-template>            
 
1508
          </xsl:call-template>
1103
1509
        </xsl:when>
1104
1510
        <xsl:otherwise>
1105
1511
          <xsl:call-template name="remove-paren">
1106
1512
            <xsl:with-param name="string" select="substring-after(., '(')"/>
1107
 
          </xsl:call-template>                      
 
1513
          </xsl:call-template>
1108
1514
        </xsl:otherwise>
1109
1515
      </xsl:choose>
1110
 
    </xsl:variable>      
1111
 
        
 
1516
    </xsl:variable>
 
1517
 
1112
1518
    <xsl:variable name="arity">
1113
1519
      <xsl:call-template name="calc-arity">
1114
1520
        <xsl:with-param name="string" select="substring-before($ustring, ')')"/>
1115
 
        <xsl:with-param name="no-of-pars" select="0"/> 
 
1521
        <xsl:with-param name="no-of-pars" select="0"/>
1116
1522
      </xsl:call-template>
1117
 
    </xsl:variable> 
1118
 
    
 
1523
    </xsl:variable>
 
1524
 
1119
1525
    <xsl:choose>
1120
1526
      <xsl:when test="ancestor::cref">
1121
1527
        <a name="{substring-before(nametext, '(')}"><span class="bold_code"><xsl:value-of select="ret"/><xsl:text> </xsl:text><xsl:value-of select="nametext"/></span></a><br/>
1122
1528
      </xsl:when>
1123
1529
      <xsl:when test="ancestor::erlref">
1124
 
        <a name="{substring-before(., '(')}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
 
1530
        <xsl:variable name="fname">
 
1531
          <xsl:variable name="fname1">
 
1532
            <xsl:value-of select="substring-before(., '(')"/>
 
1533
          </xsl:variable>
 
1534
          <xsl:variable name="fname2">
 
1535
            <xsl:value-of select="substring-after($fname1, 'erlang:')"/>
 
1536
          </xsl:variable>
 
1537
          <xsl:choose>
 
1538
            <xsl:when test="string-length($fname2) > 0">
 
1539
              <xsl:value-of select="$fname2"/>
 
1540
            </xsl:when>
 
1541
            <xsl:otherwise>
 
1542
              <xsl:value-of select="$fname1"/>
 
1543
            </xsl:otherwise>
 
1544
          </xsl:choose>
 
1545
        </xsl:variable>
 
1546
        <a name="{$fname}-{$arity}"><span class="bold_code"><xsl:value-of select="."/></span></a><br/>
1125
1547
      </xsl:when>
 
1548
      <xsl:otherwise>
 
1549
        <span class="bold_code"><xsl:value-of select="."/></span>
 
1550
      </xsl:otherwise>
1126
1551
    </xsl:choose>
1127
 
      
1128
1552
 
1129
1553
  </xsl:template>
1130
1554
 
1131
 
 
1132
1555
  <!-- Type -->
1133
1556
  <xsl:template match="type">
1134
1557
    <xsl:param name="partnum"/>
1135
1558
 
1136
 
    <div class="REFBODY"><p>Types:</p>  
 
1559
    <div class="REFBODY"><p>Types:</p>
1137
1560
 
1138
1561
      <xsl:apply-templates>
1139
1562
        <xsl:with-param name="partnum" select="$partnum"/>
1140
1563
      </xsl:apply-templates>
1141
1564
    </div>
1142
 
    
 
1565
 
1143
1566
  </xsl:template>
1144
1567
 
1145
1568
 
1167
1590
 
1168
1591
  <!-- Desc -->
1169
1592
  <xsl:template match="desc">
 
1593
    <xsl:param name="partnum"/>
1170
1594
    <div class="REFBODY">
1171
1595
      <p>
1172
1596
        <xsl:apply-templates>
1197
1621
        <xsl:variable name="modulepart"><xsl:value-of select="substring-before($filepart, ':')"/></xsl:variable>
1198
1622
        <xsl:choose>
1199
1623
          <xsl:when test="string-length($modulepart) > 0">
1200
 
            <xsl:variable name="filepart1"><xsl:value-of select="substring-after($filepart, ':')"/></xsl:variable>     
 
1624
            <xsl:variable name="filepart1"><xsl:value-of select="substring-after($filepart, ':')"/></xsl:variable>
1201
1625
            <span class="bold_code"><a href="javascript:erlhref('{$topdocdir}/../','{$modulepart}','{$filepart1}.html#{$linkpart}');"><xsl:apply-templates/></a></span>
1202
1626
          </xsl:when>
1203
1627
          <xsl:otherwise>
1204
1628
            <xsl:choose>
 
1629
              <!-- Dialyzer seealso (the application is unknown) -->
 
1630
              <xsl:when test="string-length($specs_file) > 0
 
1631
                              and count($i/specs/module[@name=$filepart]) = 0">
 
1632
                <!-- Deemed to slow; use key() instead
 
1633
                <xsl:variable name="app"
 
1634
                              select="$m2a/mod2app/module[@name=$filepart]"/>
 
1635
                -->
 
1636
                <xsl:variable name="reftext" select="text()"/>
 
1637
                <xsl:for-each select="$m2a">
 
1638
                  <xsl:variable name="app" select="key('mod2app', $filepart)"/>
 
1639
                  <xsl:choose>
 
1640
                    <xsl:when test="string-length($app) > 0">
 
1641
                      <span class="bold_code"><a href="javascript:erlhref('{$topdocdir}/../','{$app}','{$filepart}.html');"><xsl:value-of select="$reftext"/></a></span>
 
1642
                    </xsl:when>
 
1643
                    <xsl:otherwise>
 
1644
                      <!-- Unknown application; no link -->
 
1645
                      <xsl:value-of select="$reftext"/>
 
1646
                    </xsl:otherwise>
 
1647
                  </xsl:choose>
 
1648
                </xsl:for-each>
 
1649
              </xsl:when>
1205
1650
              <xsl:when test="string-length($linkpart) > 0">
1206
1651
                <span class="bold_code"><a href="{$filepart}.html#{$linkpart}"><xsl:apply-templates/></a></span>
1207
1652
              </xsl:when>
1208
 
              <xsl:otherwise>        
1209
 
                <span class="bold_code"><a href="{$filepart}.html"><xsl:apply-templates/></a></span>        
 
1653
              <xsl:otherwise>
 
1654
                <span class="bold_code"><a href="{$filepart}.html"><xsl:apply-templates/></a></span>
1210
1655
              </xsl:otherwise>
1211
1656
            </xsl:choose>
1212
1657
          </xsl:otherwise>
1219
1664
          </xsl:when>
1220
1665
          <xsl:otherwise>
1221
1666
            <xsl:variable name="modulepart"><xsl:value-of select="substring-before(@marker, ':')"/></xsl:variable>
1222
 
            
 
1667
 
1223
1668
            <xsl:choose>
1224
1669
              <xsl:when test="string-length($modulepart) > 0">
1225
 
                <xsl:variable name="filepart1"><xsl:value-of select="substring-after(@marker, ':')"/></xsl:variable>     
 
1670
                <xsl:variable name="filepart1"><xsl:value-of select="substring-after(@marker, ':')"/></xsl:variable>
1226
1671
                <span class="bold_code"><a href="javascript:erlhref('{$topdocdir}/../','{$modulepart}','{$filepart1}.html');"><xsl:apply-templates/></a></span>
1227
1672
              </xsl:when>
1228
1673
              <xsl:otherwise>
1229
 
                <span class="bold_code"><a href="{@marker}.html"><xsl:apply-templates/></a></span>        
 
1674
                <span class="bold_code"><a href="{@marker}.html"><xsl:apply-templates/></a></span>
1230
1675
              </xsl:otherwise>
1231
 
            </xsl:choose>            
 
1676
            </xsl:choose>
1232
1677
          </xsl:otherwise>
1233
1678
        </xsl:choose>
1234
1679
      </xsl:otherwise>
1253
1698
        <xsl:choose>
1254
1699
          <xsl:when test="ancestor::parts">
1255
1700
            <a href="users_guide_glossary.html#{@id}"><xsl:value-of select="@id"/></a>
1256
 
          </xsl:when> 
1257
 
          <xsl:when test="ancestor::applications"> 
 
1701
          </xsl:when>
 
1702
          <xsl:when test="ancestor::applications">
1258
1703
            <a href="ref_man_glossary.html#{@id}"><xsl:value-of select="@id"/></a>
1259
 
          </xsl:when>        
 
1704
          </xsl:when>
1260
1705
        </xsl:choose>
1261
1706
      </xsl:when>
1262
1707
      <xsl:otherwise>
1263
1708
        <a href="{$topdocdir}/glossary.html#{@id}"><xsl:value-of select="@id"/></a>
1264
1709
      </xsl:otherwise>
1265
 
    </xsl:choose -->            
 
1710
    </xsl:choose -->
1266
1711
  </xsl:template>
1267
1712
 
1268
1713
  <xsl:template match="cite">
1286
1731
 
1287
1732
    <center><h4>Version <xsl:value-of select="$appver"/></h4></center>
1288
1733
    <center><h4><xsl:value-of select="$gendate"/></h4></center>
1289
 
    
 
1734
 
1290
1735
    <xsl:apply-templates select="chapter"/>
1291
 
          
 
1736
 
1292
1737
  </xsl:template>
1293
1738
 
1294
1739
  <!-- Menu.rn -->
1321
1766
          </xsl:call-template>
1322
1767
        </ul>
1323
1768
      </div>
1324
 
    </div>            
 
1769
    </div>
1325
1770
  </xsl:template>
1326
1771
 
1327
1772
  <!-- Glossary -->
1334
1779
        <title>Erlang Documentation -- <xsl:value-of select="header/title"/></title>
1335
1780
      </head>
1336
1781
      <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000">
1337
 
        
 
1782
 
1338
1783
        <div id="container">
1339
1784
          <script id="js" type="text/javascript" language="JavaScript" src="{$topdocdir}/js/flipmenu/flipmenu.js"/>
1340
1785
          <script id="js2" type="text/javascript" src="{$topdocdir}/js/erlresolvelinks.js"></script>
1341
1786
 
1342
1787
          <!-- Generate menu -->
1343
1788
          <xsl:call-template name="menu"/>
1344
 
   
 
1789
 
1345
1790
          <div id="content">
1346
1791
            <div class="innertube">
1347
1792
              <h1>Glossary</h1>
1389
1834
        <title>Erlang Documentation -- <xsl:value-of select="header/title"/></title>
1390
1835
      </head>
1391
1836
      <body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000">
1392
 
        
 
1837
 
1393
1838
        <div id="container">
1394
1839
          <script id="js" type="text/javascript" language="JavaScript" src="{$topdocdir}/js/flipmenu/flipmenu.js"/>
1395
1840
          <script id="js2" type="text/javascript" src="{$topdocdir}/js/erlresolvelinks.js"></script>
1396
1841
 
1397
1842
          <!-- Generate menu -->
1398
1843
          <xsl:call-template name="menu"/>
1399
 
   
 
1844
 
1400
1845
          <div id="content">
1401
1846
            <div class="innertube">
1402
1847
              <h1>Bibliography</h1>
1409
1854
                  <tr>
1410
1855
                    <td><xsl:value-of select="@id"/></td>
1411
1856
                    <td><xsl:value-of select="citedef"/></td>
1412
 
                  </tr>     
1413
 
                </xsl:if>                
 
1857
                  </tr>
 
1858
                </xsl:if>
1414
1859
              </xsl:for-each>
1415
1860
            </table>
1416
1861
 
1440
1885
  <xsl:template name="calc-arity">
1441
1886
    <xsl:param name="string"/>
1442
1887
    <xsl:param name="no-of-pars"/>
1443
 
   
 
1888
 
1444
1889
    <xsl:variable name="length">
1445
1890
      <xsl:value-of select="string-length($string)"/>
1446
1891
    </xsl:variable>
1449
1894
      <xsl:when test="$length > 0">
1450
1895
        <xsl:call-template name="calc-arity">
1451
1896
          <xsl:with-param name="string" select="substring-after($string, ',')"/>
1452
 
          <xsl:with-param name="no-of-pars" select="$no-of-pars+1"/> 
1453
 
        </xsl:call-template>        
 
1897
          <xsl:with-param name="no-of-pars" select="$no-of-pars+1"/>
 
1898
        </xsl:call-template>
1454
1899
      </xsl:when>
1455
1900
      <xsl:otherwise>
1456
1901
        <xsl:value-of select="$no-of-pars"/>
1458
1903
    </xsl:choose>
1459
1904
  </xsl:template>
1460
1905
 
 
1906
 
1461
1907
  <xsl:template name="remove-paren">
1462
1908
    <xsl:param name="string"/>
1463
 
   
1464
 
    <xsl:variable name="bstring">
1465
 
      <xsl:value-of select="substring-before($string, '(')"/>
 
1909
 
 
1910
    <xsl:variable name="str1">
 
1911
      <xsl:call-template name="remove-paren-1">
 
1912
        <xsl:with-param name="string" select="$string"/>
 
1913
        <xsl:with-param name="start">(</xsl:with-param>
 
1914
        <xsl:with-param name="end">)</xsl:with-param>
 
1915
      </xsl:call-template>
 
1916
    </xsl:variable>
 
1917
 
 
1918
    <xsl:variable name="str2">
 
1919
      <xsl:call-template name="remove-paren-1">
 
1920
        <xsl:with-param name="string" select="$str1"/>
 
1921
        <xsl:with-param name="start">{</xsl:with-param>
 
1922
        <xsl:with-param name="end">}</xsl:with-param>
 
1923
      </xsl:call-template>
 
1924
    </xsl:variable>
 
1925
 
 
1926
    <xsl:variable name="str3">
 
1927
      <xsl:call-template name="remove-paren-1">
 
1928
        <xsl:with-param name="string" select="$str2"/>
 
1929
        <xsl:with-param name="start">[</xsl:with-param>
 
1930
        <xsl:with-param name="end">]</xsl:with-param>
 
1931
      </xsl:call-template>
 
1932
    </xsl:variable>
 
1933
 
 
1934
    <xsl:value-of select="$str3"/>
 
1935
 
 
1936
  </xsl:template>
 
1937
 
 
1938
 
 
1939
  <xsl:template name="remove-paren-1">
 
1940
    <xsl:param name="string"/>
 
1941
    <xsl:param name="start"/>
 
1942
    <xsl:param name="end"/>
 
1943
 
 
1944
    <xsl:variable name="tmp1">
 
1945
      <xsl:value-of select="substring-before($string, $start)"/>
1466
1946
    </xsl:variable>
1467
1947
 
1468
1948
    <xsl:choose>
1469
 
      <xsl:when test="string-length($bstring) > 0">
1470
 
        <xsl:variable name="astring">
1471
 
          <xsl:value-of select="substring-after($string, ')')"/>
 
1949
      <xsl:when test="string-length($tmp1) > 0 or starts-with($string, $start)">
 
1950
        <xsl:variable name="tmp2">
 
1951
          <xsl:value-of select="substring-after($string, $end)"/>
1472
1952
        </xsl:variable>
1473
1953
        <xsl:variable name="retstring">
1474
1954
          <xsl:call-template name="remove-paren">
1475
 
            <xsl:with-param name="string" select="$astring"/>
1476
 
          </xsl:call-template>        
 
1955
            <xsl:with-param name="string" select="$tmp2"/>
 
1956
          </xsl:call-template>
1477
1957
        </xsl:variable>
1478
 
        <xsl:value-of select="concat($bstring, $retstring)"/>
 
1958
        <xsl:value-of select="concat(concat($tmp1, 'x'), $retstring)"/>
1479
1959
      </xsl:when>
1480
1960
      <xsl:otherwise>
1481
1961
        <xsl:value-of select="$string"/>
1482
1962
      </xsl:otherwise>
1483
1963
    </xsl:choose>
 
1964
 
1484
1965
  </xsl:template>
1485
1966
 
1486
1967
</xsl:stylesheet>