Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                version='1.0'>
4

    
5

    
6
<!-- ********************************************************************
7
     $Id: biblio.xsl 6402 2006-11-12 08:23:21Z bobstayton $
8
     ********************************************************************
9

    
10
     This file is part of the XSL DocBook Stylesheet distribution.
11
     See ../README or http://docbook.sf.net/release/xsl/current/ for
12
     copyright and other information.
13

    
14
     The original code for processing bibliography in ISO690 style
15
     was provided by Jana Dvorakova <jana4u@seznam.cz>
16

    
17
     ******************************************************************** -->
18

    
19
<!-- ==================================================================== -->
20

    
21
<!-- if biblioentry.alt.primary.seps is set to nonzero value then use alternative separators for primary responsibility - $alt.person.two.sep, $alt.person.last.sep, $alt.person.more.sep  -->
22
<xsl:param name="biblioentry.alt.primary.seps" select="0"/>
23

    
24
<!-- how many authors will be printed if there is more than three authors - set to number 1 (default value), 2 or 3 -->
25
<xsl:param name="biblioentry.primary.count" select="1"/>
26

    
27
<!-- ==================================================================== -->
28

    
29
<xsl:template name="iso690.makecitation">
30
<!-- Types of resources -->
31
  <xsl:choose>
32

    
33
    <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ENTIRE MESSAGE SYSTEM -->
34
    <!-- same as Monographs -->
35
    <xsl:when test="./@role='messagesystem'">
36
      <xsl:call-template name="iso690.monogr"/>
37
    </xsl:when>
38

    
39
    <!-- SYSTEMS OF ELECTRONIC COMMUNICATION : ELECTRONIC MESSAGES -->
40
    <!-- same as Contributions to Monographs -->
41
    <xsl:when test="./@role='message'">
42
      <xsl:call-template name="iso690.paper.mon"/>
43
    </xsl:when>
44

    
45
    <!-- SERIALS -->
46
    <xsl:when test="./@role='serial' or ./biblioid/@class='issn' or ./issn">
47
      <xsl:call-template name="iso690.serial"/>
48
    </xsl:when>
49

    
50
    <!-- PARTS OF MONOGRAPHS -->
51
    <xsl:when test="./@role='part' or (./bibliomisc[@role='secnum']|./bibliomisc[@role='sectitle'])">
52
      <xsl:call-template name="iso690.monogr.part"/>
53
    </xsl:when>
54

    
55
    <!-- CONTRIBUTIONS TO MONOGRAPHS -->
56
    <xsl:when test="./@role='contribution' or (./biblioset/@relation='part' and ./biblioset/@relation='book')">
57
      <xsl:call-template name="iso690.paper.mon"/>
58
    </xsl:when>
59

    
60
    <!-- ARTICLES, ETC., IN SERIALS -->
61
    <xsl:when test="./@role='article' or (./biblioset/@relation='journal' and ./biblioset/@relation='article')">
62
      <xsl:call-template name="iso690.article"/>
63
    </xsl:when>
64

    
65
    <!-- PATENT DOCUMENTS -->
66
    <xsl:when test="./@role='patent' or (./bibliomisc[@role='patenttype'] and ./bibliomisc[@role='patentnum'])">
67
      <xsl:call-template name="iso690.patent"/>
68
    </xsl:when>
69

    
70
    <!-- MONOGRAPHS -->
71
    <xsl:otherwise>
72
      <xsl:call-template name="iso690.monogr"/>
73
    </xsl:otherwise>
74

    
75
  </xsl:choose>
76
</xsl:template>
77

    
78
<!-- ==================================================================== -->
79

    
80
<!-- MONOGRAPHS -->
81
<xsl:template name="iso690.monogr">
82
  <!-- Primary responsibility -->
83
  <xsl:call-template name="iso690.primary"/>
84
  <!-- Title and Type of medium -->
85
  <xsl:call-template name="iso690.title"/>
86
  <!-- Subordinate responsibility -->
87
  <xsl:call-template name="iso690.secondary"/>
88
  <!-- Edition -->
89
  <xsl:call-template name="iso690.edition"/>
90
  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
91
  <xsl:call-template name="iso690.pub"/>
92
  <!-- Extent -->
93
  <xsl:call-template name="iso690.extent"/>
94
  <!-- Series -->
95
  <xsl:call-template name="iso690.serie"/>
96
  <!-- Notes -->
97
  <xsl:call-template name="iso690.notice"/>
98
  <!-- Avaibility and access -->
99
  <xsl:call-template name="iso690.access"/>
100
  <!-- Standard number -->
101
  <xsl:call-template name="iso690.isbn"/>
102
</xsl:template>
103

    
104
<!-- SERIALS -->
105
<xsl:template name="iso690.serial">
106
  <!-- Title and Type of medium -->
107
  <xsl:call-template name="iso690.title"/>
108
  <!-- Responsibility [nonEL] -->
109
  <xsl:if test="not(./bibliomisc[@role='medium'])">
110
    <xsl:call-template name="iso690.secondary"/>
111
  </xsl:if>
112
  <!-- Edition -->
113
  <xsl:call-template name="iso690.edition">
114
    <xsl:with-param name="after" select="./bibliomisc[@role='issuing']"/>
115
  </xsl:call-template>
116
  <!-- Issue designation (date and/or num) [nonEL] -->
117
  <xsl:if test="not(./bibliomisc[@role='medium'])">
118
    <xsl:call-template name="iso690.issuing"/>
119
  </xsl:if>
120
  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
121
  <xsl:call-template name="iso690.pub"/>
122
  <!-- Series -->
123
  <xsl:call-template name="iso690.serie"/>
124
  <!-- Notes -->
125
  <xsl:call-template name="iso690.notice"/>
126
  <!-- Avaibility and access -->
127
  <xsl:call-template name="iso690.access"/>
128
  <!-- Standard number -->
129
  <xsl:call-template name="iso690.issn"/>
130
</xsl:template>
131

    
132
<!-- PARTS OF MONOGRAPHS -->
133
<xsl:template name="iso690.monogr.part">
134
  <!-- Primary responsibility of host document -->
135
  <xsl:call-template name="iso690.primary"/>
136
  <!-- Title and Type of medium of host document -->
137
  <xsl:call-template name="iso690.title"/>
138
  <!-- Subordinate responsibility of host document [EL] -->
139
  <xsl:if test="./bibliomisc[@role='medium']">
140
    <xsl:call-template name="iso690.secondary"/>
141
  </xsl:if>
142
  <!-- Edition -->
143
  <xsl:call-template name="iso690.edition">
144
    <xsl:with-param name="after" select="./volumenum"/>
145
  </xsl:call-template>
146
  <!-- Numeration of the part [nonEL]-->
147
  <xsl:if test="not(./bibliomisc[@role='medium'])">
148
    <xsl:call-template name="iso690.partnr"/>
149
  <!-- Subordinate responsibility [nonEL] -->
150
    <xsl:call-template name="iso690.secondary"/>
151
  </xsl:if>
152
  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
153
  <xsl:call-template name="iso690.pub"/>
154
  <!-- Location within host -->
155
  <xsl:call-template name="iso690.part.location"/>
156
  <xsl:if test="./bibliomisc[@role='medium']">
157
  <!-- Numeration within host document [EL] -->
158
  <!-- Notes [EL] -->
159
    <xsl:call-template name="iso690.notice"/>
160
  <!-- Avaibility and access [EL] -->
161
    <xsl:call-template name="iso690.access"/>
162
  <!-- Standard number [EL] -->
163
    <xsl:call-template name="iso690.isbn"/>
164
  </xsl:if>
165
</xsl:template>
166

    
167
<!-- CONTRIBUTIONS TO MONOGRAPHS -->
168
<xsl:template name="iso690.paper.mon">
169
<!-- Contribution -->
170
  <xsl:apply-templates mode="iso690.paper.part" select="./biblioset[@relation='part']"/>
171
<!-- In -->
172
  <xsl:text>In </xsl:text>
173
<!-- Host -->
174
  <xsl:apply-templates mode="iso690.paper.book" select="./biblioset[@relation='book']"/>
175
</xsl:template>
176

    
177
<xsl:template match="biblioset" mode="iso690.paper.part">
178
<!-- Contribution -->
179
  <!-- Primary responsibility -->
180
  <xsl:call-template name="iso690.primary"/>
181
  <!-- Title -->
182
  <xsl:call-template name="iso690.title">
183
    <xsl:with-param name="italic" select="0"/>
184
  </xsl:call-template>
185
</xsl:template>
186

    
187
<xsl:template match="biblioset" mode="iso690.paper.book">
188
<!-- Host -->
189
  <!-- Primary responsibility -->
190
  <xsl:call-template name="iso690.primary"/>
191
  <!-- Title and Type of medium -->
192
  <xsl:call-template name="iso690.title"/>
193
  <!-- Subordinate responsibility [EL] -->
194
  <xsl:if test="./bibliomisc[@role='medium']">
195
    <xsl:call-template name="iso690.secondary"/>
196
  </xsl:if>
197
  <!-- Edition -->
198
  <xsl:call-template name="iso690.edition"/>
199
  <!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
200
  <xsl:call-template  name="iso690.paper.pub"/>
201
  <!-- Numeration within host document [EL] -->
202
  <!-- Location within host -->
203
  <xsl:call-template name="iso690.location"/>
204
  <xsl:if test="./bibliomisc[@role='medium']">
205
  <!-- Notes [EL] -->
206
    <xsl:call-template name="iso690.notice"/>
207
  <!-- Avaibility and access [EL] -->
208
    <xsl:call-template name="iso690.access"/>
209
  <!-- Standard number [EL] -->
210
    <xsl:call-template name="iso690.isbn"/>
211
  </xsl:if>
212
</xsl:template>
213

    
214
<!-- ARTICLES, ETC., IN SERIALS -->
215
<xsl:template name="iso690.article">
216
<!-- Article -->
217
  <xsl:apply-templates mode="iso690.article.art" select="./biblioset[@relation='article']"/>
218
<!-- Serial -->
219
  <xsl:apply-templates mode="iso690.article.jour" select="./biblioset[@relation='journal']"/>
220
</xsl:template>
221

    
222
<xsl:template match="biblioset" mode="iso690.article.art">
223
<!-- Article -->
224
  <!-- Primary responsibility -->
225
  <xsl:call-template name="iso690.primary"/>
226
  <!-- Title -->
227
  <xsl:call-template name="iso690.title">
228
    <xsl:with-param name="italic" select="0"/>
229
  </xsl:call-template>
230
  <!-- Subordinate responsibility [nonEL] -->
231
  <xsl:if test="not(../*/bibliomisc[@role='medium'])">
232
    <xsl:call-template name="iso690.secondary"/>
233
  </xsl:if>
234
</xsl:template>
235

    
236
<xsl:template match="biblioset" mode="iso690.article.jour">
237
<!-- Serial -->
238
  <!-- Title and Type of medium -->
239
  <xsl:call-template name="iso690.title"/>
240
  <!-- Edition -->
241
  <xsl:call-template name="iso690.edition">
242
    <xsl:with-param name="after" select="./pubdate[not(@role='issuing')]|./volumenum|./issuenum|./pagenums"/>
243
  </xsl:call-template>
244
  <!-- Number designation [EL] -->
245
  <!-- Location within host -->
246
  <xsl:call-template name="iso690.article.location"/>
247
  <xsl:if test="./bibliomisc[@role='medium']">
248
  <!-- Notes [EL] -->
249
    <xsl:call-template name="iso690.notice"/>
250
  <!-- Avaibility and access [EL] -->
251
    <xsl:call-template name="iso690.access"/>
252
  <!-- Standard number [EL] -->
253
    <xsl:call-template name="iso690.issn"/>
254
  </xsl:if>
255
</xsl:template>
256

    
257
<!-- PATENT DOCUMENTS -->
258
<xsl:template name="iso690.patent">
259
  <!-- Primary responsibility (applicant) -->
260
  <xsl:call-template name="iso690.primary"/>
261
  <!-- Title of the invention -->
262
  <xsl:call-template name="iso690.title"/>
263
  <!-- Subordinate responsibility -->
264
  <xsl:call-template name="iso690.secondary"/>
265
  <!-- Notes -->
266
  <xsl:call-template name="iso690.notice"/>
267
  <!-- Identification -->
268
  <xsl:call-template name="iso690.pat.ident"/>
269
</xsl:template>
270

    
271
<!-- ==================================================================== -->
272
<!-- Elements -->
273

    
274
<!-- Primary responsibility -->
275
<xsl:template name="iso690.primary">
276
  <xsl:param name="primary.sep">
277
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
278
  </xsl:param>
279
  <xsl:choose>
280
    <xsl:when test="./authorgroup/author|./author">
281
      <xsl:call-template name="iso690.author.list">
282
        <xsl:with-param name="person.list" select=".//authorgroup/author|.//author"/>
283
      </xsl:call-template>
284
    </xsl:when>
285
    <xsl:when test="./authorgroup/editor|./editor">
286
      <xsl:call-template name="iso690.author.list">
287
        <xsl:with-param name="person.list" select=".//authorgroup/editor|.//editor"/>
288
      </xsl:call-template>
289
    </xsl:when>
290
    <xsl:when test="./authorgroup/corpauthor|./corpauthor">
291
      <xsl:call-template name="iso690.author.list">
292
        <xsl:with-param name="person.list" select=".//authorgroup/corpauthor|.//corpauthor"/>
293
      </xsl:call-template>
294
    </xsl:when>
295
    <xsl:otherwise>
296
      <xsl:if test="(./firstname)and(./surname)">
297
        <xsl:call-template name="iso690.author"/>
298
        <xsl:call-template name="iso690.endsep">
299
          <xsl:with-param name="text" select="string(./firstname[1])"/>
300
          <xsl:with-param name="sep" select="$primary.sep"/>
301
        </xsl:call-template>
302
      </xsl:if>
303
    </xsl:otherwise>
304
  </xsl:choose>
305
</xsl:template>
306

    
307
<xsl:template name="iso690.author.list">
308
  <xsl:param name="person.list"
309
             select="author|corpauthor|editor"/>
310
  <xsl:param name="person.count" select="count($person.list)"/>
311
  <xsl:param name="count" select="1"/>
312
  <xsl:param name="group" select="./authorgroup[@role='many']"/>
313
  <xsl:param name="many" select="0"/>
314

    
315
  <xsl:param name="primary.many">
316
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.many'"/></xsl:call-template>
317
  </xsl:param>
318
  <xsl:param name="primary.editor">
319
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.editor'"/></xsl:call-template>
320
  </xsl:param>
321
  <xsl:param name="primary.sep">
322
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'primary.sep'"/></xsl:call-template>
323
  </xsl:param>
324

    
325
  <xsl:choose>
326
    <xsl:when test="$count &gt; $person.count"></xsl:when>
327
    <xsl:otherwise>
328
      <xsl:choose>
329
        <xsl:when test="$person.count &lt; 4 and not($group)">
330
          <xsl:call-template name="iso690.author">
331
            <xsl:with-param name="node" select="$person.list[position()=$count]"/>
332
          </xsl:call-template>
333
          <xsl:choose>
334
            <xsl:when test="$person.count = 2 and $count = 1 and $biblioentry.alt.primary.seps != 0">
335
              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.two.sep'"/></xsl:call-template>
336
            </xsl:when>
337
            <xsl:when test="$person.count = 2 and $count = 1">
338
              <xsl:call-template name="gentext.template">
339
                <xsl:with-param name="context" select="'authorgroup'"/>
340
                <xsl:with-param name="name" select="'sep2'"/>
341
              </xsl:call-template>
342
            </xsl:when>
343
            <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count and $biblioentry.alt.primary.seps != 0">
344
              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.last.sep'"/></xsl:call-template>
345
            </xsl:when>
346
            <xsl:when test="$person.count &gt; 2 and $count+1 = $person.count">
347
              <xsl:call-template name="gentext.template">
348
                <xsl:with-param name="context" select="'authorgroup'"/>
349
                <xsl:with-param name="name" select="'seplast'"/>
350
              </xsl:call-template>
351
            </xsl:when>
352
            <xsl:when test="$count &lt; $person.count and $biblioentry.alt.primary.seps != 0">
353
              <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'alt.person.more.sep'"/></xsl:call-template>
354
            </xsl:when>
355
            <xsl:when test="$count &lt; $person.count">
356
              <xsl:call-template name="gentext.template">
357
                <xsl:with-param name="context" select="'authorgroup'"/>
358
                <xsl:with-param name="name" select="'sep'"/>
359
              </xsl:call-template>
360
            </xsl:when>
361
            <xsl:when test="($count = $person.count)">
362
              <xsl:choose>
363
                <xsl:when test="$many!=0">
364
                  <xsl:if test="name($person.list[position()=$count])='editor'">
365
                    <xsl:value-of select="$primary.editor"/>
366
                  </xsl:if>
367
                  <xsl:value-of select="$primary.many"/>
368
                  <xsl:call-template name="iso690.endsep">
369
                    <xsl:with-param name="text" select="$primary.many"/>
370
                    <xsl:with-param name="sep" select="$primary.sep"/>
371
                  </xsl:call-template>
372
                </xsl:when>
373
                <xsl:when test="name($person.list[position()=$count])='editor'">
374
                  <xsl:value-of select="$primary.editor"/>
375
                  <xsl:value-of select="$primary.sep"/>
376
                </xsl:when>
377
                <xsl:when test="name($person.list[position()=$count])='corpauthor'">
378
                  <xsl:call-template name="iso690.endsep">
379
                    <xsl:with-param name="text" select="string($person.list[position()=$count])"/>
380
                    <xsl:with-param name="sep" select="$primary.sep"/>
381
                  </xsl:call-template>
382
                </xsl:when>
383
                <xsl:otherwise>
384
                  <xsl:call-template name="iso690.endsep">
385
                    <xsl:with-param name="text" select="string($person.list[position()=$count]//firstname[1])"/>
386
                    <xsl:with-param name="sep" select="$primary.sep"/>
387
                  </xsl:call-template>
388
                </xsl:otherwise>
389
              </xsl:choose>
390
            </xsl:when>
391
          </xsl:choose>
392

    
393
          <xsl:call-template name="iso690.author.list">
394
            <xsl:with-param name="person.list" select="$person.list"/>
395
            <xsl:with-param name="person.count" select="$person.count"/>
396
            <xsl:with-param name="count" select="$count+1"/>
397
            <xsl:with-param name="many" select="$many"/>
398
            <xsl:with-param name="group"/>
399
          </xsl:call-template>
400
        </xsl:when>
401

    
402
        <xsl:otherwise>
403
          <xsl:choose>
404
            <xsl:when test="($biblioentry.primary.count&gt;=3) and ($person.count&gt;=3)">
405
              <xsl:call-template name="iso690.author.list">
406
                <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]|$person.list[3]"/>
407
                <xsl:with-param name="person.count" select="3"/>
408
                <xsl:with-param name="count" select="1"/>
409
                <xsl:with-param name="many" select="1"/>
410
                <xsl:with-param name="group"/>
411
              </xsl:call-template>
412
            </xsl:when>
413
            <xsl:when test="($biblioentry.primary.count&gt;1) and  ($person.count&gt;1)">
414
              <xsl:call-template name="iso690.author.list">
415
                <xsl:with-param name="person.list" select="$person.list[1]|$person.list[2]"/>
416
                <xsl:with-param name="person.count" select="2"/>
417
                <xsl:with-param name="count" select="1"/>
418
                <xsl:with-param name="many" select="1"/>
419
                <xsl:with-param name="group"/>
420
              </xsl:call-template>
421
            </xsl:when>
422
            <xsl:otherwise>
423
              <xsl:call-template name="iso690.author.list">
424
                <xsl:with-param name="person.list" select="$person.list[1]"/>
425
                <xsl:with-param name="person.count" select="1"/>
426
                <xsl:with-param name="count" select="1"/>
427
                <xsl:with-param name="many" select="1"/>
428
                <xsl:with-param name="group"/>
429
              </xsl:call-template>
430
            </xsl:otherwise>
431
          </xsl:choose>
432
        </xsl:otherwise>
433
      </xsl:choose>
434
    </xsl:otherwise>
435
  </xsl:choose>
436
</xsl:template>
437

    
438
<xsl:template name="iso690.author">
439
  <xsl:param name="node" select="."/>
440
  <xsl:param name="lastfirst.sep">
441
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'lastfirst.sep'"/></xsl:call-template>
442
  </xsl:param>
443
  <xsl:choose>
444
    <xsl:when test="name($node)!='corpauthor'">
445
      <span style="text-transform:uppercase">
446
        <xsl:apply-templates mode="iso690.mode" select="$node//surname[1]"/>
447
      </span>
448
      <xsl:if test="$node//surname and $node//firstname">
449
        <xsl:value-of select="$lastfirst.sep"/>
450
      </xsl:if>
451
      <xsl:apply-templates mode="iso690.mode" select="$node//firstname[1]"/>
452
    </xsl:when>
453
    <xsl:otherwise>
454
      <span style="text-transform:uppercase">
455
        <xsl:apply-templates mode="iso690.mode" select="$node"/>
456
      </span>
457
    </xsl:otherwise>
458
  </xsl:choose>
459
</xsl:template>
460

    
461
<xsl:template match="corpauthor|firstname|surname" mode="iso690.mode">
462
  <xsl:apply-templates mode="iso690.mode"/>
463
</xsl:template>
464

    
465
<!-- Title and Type of medium -->
466
<xsl:template name="iso690.title">
467
  <xsl:param name="medium" select="./bibliomisc[@role='medium']"/>
468
  <xsl:param name="italic" select="1"/>
469
  <xsl:param name="sep">
470
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
471
  </xsl:param>
472

    
473
  <xsl:apply-templates mode="iso690.mode" select="./title">
474
    <xsl:with-param name="medium" select="$medium"/>
475
    <xsl:with-param name="italic" select="$italic"/>
476
    <xsl:with-param name="sep" select="$sep"/>
477
  </xsl:apply-templates>
478
</xsl:template>
479

    
480
<xsl:template match="title" mode="iso690.mode">
481
  <xsl:param name="medium"/>
482
  <xsl:param name="italic" select="1"/>
483
  <xsl:param name="sep">
484
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'title.sep'"/></xsl:call-template>
485
  </xsl:param>
486
  <xsl:param name="medium1">
487
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium1'"/></xsl:call-template>
488
  </xsl:param>
489
  <xsl:param name="medium2">
490
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'medium2'"/></xsl:call-template>
491
  </xsl:param>
492
  <xsl:choose>
493
    <xsl:when test="$italic=1">
494
      <xsl:call-template name="iso690.italic.title"/>
495
    </xsl:when>
496
    <xsl:otherwise>
497
      <xsl:call-template name="iso690.make.title"/>
498
    </xsl:otherwise>
499
  </xsl:choose>
500
  <xsl:if test="$medium">
501
    <xsl:value-of select="$medium1"/>
502
    <xsl:apply-templates mode="iso690.mode" select="$medium"/>
503
    <xsl:value-of select="$medium2"/>
504
  </xsl:if>
505
  <xsl:call-template name="iso690.endsep">
506
    <xsl:with-param name="text" select="concat(string(.),string(../subtitle))"/>
507
    <xsl:with-param name="sep" select="$sep"/>
508
  </xsl:call-template>
509
</xsl:template>
510

    
511
<xsl:template name="iso690.italic.title">
512
  <i>
513
    <xsl:call-template name="iso690.make.title"/>
514
  </i>
515
</xsl:template>
516

    
517
<xsl:template name="iso690.make.title">
518
  <xsl:param name="submaintitle.sep">
519
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'submaintitle.sep'"/></xsl:call-template>
520
  </xsl:param>
521
  <xsl:apply-templates mode="iso690.mode"/>
522
  <xsl:if test="../subtitle">
523
    <xsl:value-of select="$submaintitle.sep"/>
524
    <xsl:apply-templates mode="iso690.mode" select="../subtitle"/>
525
  </xsl:if>
526
</xsl:template>
527

    
528
<xsl:template match="subtitle" mode="iso690.mode">
529
  <xsl:apply-templates mode="iso690.mode"/>
530
</xsl:template>
531

    
532
<xsl:template match="bibliomisc[@role='medium']" mode="iso690.mode">
533
  <xsl:apply-templates mode="iso690.mode"/>
534
</xsl:template>
535

    
536
<!-- Subordinate responsibility -->
537
<xsl:template name="iso690.secondary">
538
  <xsl:param name="secondary.sep">
539
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.sep'"/></xsl:call-template>
540
  </xsl:param>
541
  <xsl:param name="secondary.person.sep">
542
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'secondary.person.sep'"/></xsl:call-template>
543
  </xsl:param>
544
  <xsl:for-each select="./bibliomisc[@role='secondary']">
545
    <xsl:apply-templates mode="iso690.mode" select="."/>
546
    <xsl:choose>
547
      <xsl:when test="position()=count(../bibliomisc[@role='secondary'])">
548
        <xsl:call-template name="iso690.endsep">
549
          <xsl:with-param name="text" select="string(.)"/>
550
          <xsl:with-param name="sep" select="$secondary.sep"/>
551
        </xsl:call-template>
552
      </xsl:when>
553
      <xsl:otherwise>
554
        <xsl:value-of select="$secondary.person.sep"/>
555
      </xsl:otherwise>
556
    </xsl:choose>
557
  </xsl:for-each>
558
</xsl:template>
559

    
560
<xsl:template match="bibliomisc[@role='secondary']" mode="iso690.mode">
561
  <xsl:apply-templates mode="iso690.mode"/>
562
</xsl:template>
563

    
564
<!-- Edition -->
565
<xsl:template name="iso690.edition">
566
  <xsl:param name="after"/>
567
  <xsl:param name="edition.serial.sep">
568
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.serial.sep'"/></xsl:call-template>
569
  </xsl:param>
570
  <xsl:choose>
571
    <xsl:when test="string($after)!=''">
572
      <xsl:apply-templates mode="iso690.mode" select="./edition">
573
        <xsl:with-param name="sep" select="$edition.serial.sep"/>
574
      </xsl:apply-templates>
575
    </xsl:when>
576
    <xsl:otherwise>
577
      <xsl:apply-templates mode="iso690.mode" select="./edition"/>
578
    </xsl:otherwise>
579
  </xsl:choose>
580
</xsl:template>
581

    
582
<xsl:template match="edition" mode="iso690.mode">
583
  <xsl:param name="sep">
584
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'edition.sep'"/></xsl:call-template>
585
  </xsl:param>
586
  <xsl:apply-templates mode="iso690.mode"/>
587
  <xsl:call-template name="iso690.endsep">
588
    <xsl:with-param name="text" select="string(.)"/>
589
    <xsl:with-param name="sep" select="$sep"/>
590
  </xsl:call-template>
591
</xsl:template>
592

    
593
<!-- Issue designation (date and/or num) -->
594
<xsl:template name="iso690.issuing">
595
  <xsl:param name="issuing.div">
596
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
597
  </xsl:param>
598
  <xsl:param name="issuing.range">
599
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
600
  </xsl:param>
601
  <xsl:param name="issuing.sep">
602
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
603
  </xsl:param>
604
  <xsl:choose>
605
    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2] and ./issuenum[2]">
606
      <xsl:call-template name="iso690.issuedate"/>
607
      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
608
        <xsl:with-param name="sep" select="$issuing.div"/>
609
      </xsl:apply-templates>
610
      <xsl:apply-templates mode="iso690.mode" select="./issuenum[1]">
611
        <xsl:with-param name="sep" select="$issuing.range"/>
612
      </xsl:apply-templates>
613
      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
614
        <xsl:with-param name="sep" select="$issuing.div"/>
615
      </xsl:apply-templates>
616
      <xsl:apply-templates mode="iso690.mode" select="./issuenum[2]">
617
        <xsl:with-param name="sep" select="$issuing.sep"/>
618
      </xsl:apply-templates>
619
    </xsl:when>
620
    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum[2]">
621
      <xsl:call-template name="iso690.issuedate"/>
622
      <xsl:apply-templates mode="iso690.mode" select="./volumenum[1]">
623
        <xsl:with-param name="sep" select="$issuing.range"/>
624
      </xsl:apply-templates>
625
      <xsl:apply-templates mode="iso690.mode" select="./volumenum[2]">
626
        <xsl:with-param name="sep" select="$issuing.sep"/>
627
      </xsl:apply-templates>
628
    </xsl:when>
629
    <xsl:when test="./pubdate[@role='issuing'] and ./volumenum and ./issuenum">
630
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
631
        <xsl:with-param name="sep" select="$issuing.div"/>
632
      </xsl:apply-templates>
633
      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
634
        <xsl:with-param name="sep" select="$issuing.div"/>
635
      </xsl:apply-templates>
636
      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
637
        <xsl:with-param name="sep" select="$issuing.sep"/>
638
      </xsl:apply-templates>
639
    </xsl:when>
640
    <xsl:when test="./pubdate[@role='issuing']">
641
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
642
        <xsl:with-param name="sep" select="$issuing.sep"/>
643
      </xsl:apply-templates>
644
    </xsl:when>
645
    <xsl:when test="./volumenum">
646
      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
647
        <xsl:with-param name="sep" select="$issuing.sep"/>
648
      </xsl:apply-templates>
649
    </xsl:when>
650
    <xsl:when test="./issuenum">
651
      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
652
        <xsl:with-param name="sep" select="$issuing.sep"/>
653
      </xsl:apply-templates>
654
    </xsl:when>
655
  </xsl:choose>
656
</xsl:template>
657

    
658
<xsl:template name="iso690.issuedate">
659
  <xsl:param name="issuing.div">
660
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.div'"/></xsl:call-template>
661
  </xsl:param>
662
  <xsl:param name="issuing.range">
663
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.range'"/></xsl:call-template>
664
  </xsl:param>
665
  <xsl:param name="issuing.sep">
666
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issuing.sep'"/></xsl:call-template>
667
  </xsl:param>
668
  <xsl:choose>
669
    <xsl:when test="./pubdate[@role='issuing'][2]">
670
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][1]">
671
        <xsl:with-param name="sep" select="$issuing.range"/>
672
      </xsl:apply-templates>
673
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing'][2]">
674
        <xsl:with-param name="sep" select="$issuing.div"/>
675
      </xsl:apply-templates>
676
    </xsl:when>
677
    <xsl:otherwise>
678
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[@role='issuing']">
679
        <xsl:with-param name="sep" select="$issuing.div"/>
680
      </xsl:apply-templates>
681
    </xsl:otherwise>
682
  </xsl:choose>
683
</xsl:template>
684

    
685
<xsl:template match="pubdate[@role='issuing']" mode="iso690.mode">
686
  <xsl:param name="sep"/>
687
  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
688
  <xsl:apply-templates mode="iso690.mode"/>
689
  <xsl:call-template name="iso690.space">
690
    <xsl:with-param name="text" select="$substr"/>
691
  </xsl:call-template>
692
  <xsl:choose>
693
    <xsl:when test="$substr='-'">
694
      <xsl:call-template name="iso690.endsep">
695
        <xsl:with-param name="text" select="' '"/>
696
        <xsl:with-param name="sep" select="$sep"/>
697
      </xsl:call-template>
698
    </xsl:when>
699
    <xsl:otherwise>
700
      <xsl:call-template name="iso690.endsep">
701
        <xsl:with-param name="text" select="string(.)"/>
702
        <xsl:with-param name="sep" select="$sep"/>
703
      </xsl:call-template>
704
    </xsl:otherwise>
705
  </xsl:choose>
706
</xsl:template>
707

    
708
<!-- Numeration of the part -->
709
<xsl:template name="iso690.partnr">
710
  <xsl:param name="partnr.sep">
711
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'partnr.sep'"/></xsl:call-template>
712
  </xsl:param>
713
  <xsl:apply-templates mode="iso690.mode" select="./volumenum">
714
    <xsl:with-param name="sep" select="$partnr.sep"/>
715
  </xsl:apply-templates>
716
</xsl:template>
717

    
718
<!-- Place of publication, Publisher, Year/Date of publication, Date of update/revision, Date of citation -->
719
<xsl:template name="iso690.pub">
720
  <xsl:param name="onlydate" select="0"/>
721
  <xsl:param name="placesep">
722
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'placepubl.sep'"/></xsl:call-template>
723
  </xsl:param>
724
  <xsl:param name="pubsep">
725
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'publyear.sep'"/></xsl:call-template>
726
  </xsl:param>
727
  <xsl:param name="endsep">
728
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pubinfo.sep'"/></xsl:call-template>
729
  </xsl:param>
730
  <xsl:choose>
731
    <xsl:when test="(./publisher/publishername|./publishername|./publisher/address/city)and($onlydate=0)and(./pubdate[not(@role='issuing')]|./copyright/year|./date[@role='upd']|./date[@role='upd'])">
732
      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
733
        <xsl:with-param name="sep" select="$placesep"/>
734
      </xsl:apply-templates>
735
      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
736
        <xsl:with-param name="sep" select="$pubsep"/>
737
      </xsl:apply-templates>
738
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
739
        <xsl:with-param name="sep" select="$endsep"/>
740
      </xsl:apply-templates>
741
      <xsl:if test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
742
        <xsl:call-template name="iso690.data">
743
          <xsl:with-param name="sep" select="$endsep"/>
744
        </xsl:call-template>
745
      </xsl:if>
746
    </xsl:when>
747
    <xsl:when test="(./publisher/publishername|./publishername)and(./publisher/address/city)and($onlydate=0)">
748
      <xsl:apply-templates mode="iso690.mode" select="./publisher/address/city">
749
        <xsl:with-param name="sep" select="$placesep"/>
750
      </xsl:apply-templates>
751
      <xsl:apply-templates mode="iso690.mode" select="./publisher/publishername|./publishername">
752
        <xsl:with-param name="sep" select="$endsep"/>
753
      </xsl:apply-templates>
754
    </xsl:when>
755
    <xsl:when test="($onlydate=1)or(./pubdate[not(@role='issuing')]|./copyright/year)">
756
      <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]|./copyright/year">
757
        <xsl:with-param name="sep" select="$endsep"/>
758
      </xsl:apply-templates>
759
      <xsl:if test="$onlydate=1">
760
        <xsl:call-template name="iso690.location">
761
          <xsl:with-param name="onlypages" select="1"/>
762
        </xsl:call-template>
763
      </xsl:if>
764
    </xsl:when>
765
    <xsl:when test="not(./pubdate[not(@role='issuing')]|./copyright/year)">
766
      <xsl:call-template name="iso690.data">
767
        <xsl:with-param name="sep" select="$endsep"/>
768
      </xsl:call-template>
769
    </xsl:when>
770
  </xsl:choose>
771
</xsl:template>
772

    
773
<xsl:template name="iso690.paper.pub">
774
  <xsl:param name="spec.pubinfo.sep">
775
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'spec.pubinfo.sep'"/></xsl:call-template>
776
  </xsl:param>
777
  <xsl:choose>
778
    <xsl:when test="./volumnum|./issuenum|./pagenums">
779
      <xsl:call-template name="iso690.pub">
780
        <xsl:with-param name="endsep" select="$spec.pubinfo.sep"/>
781
      </xsl:call-template>
782
    </xsl:when>
783
    <xsl:otherwise>
784
      <xsl:call-template name="iso690.pub"/>
785
    </xsl:otherwise>
786
  </xsl:choose>
787
</xsl:template>
788

    
789
<xsl:template name="iso690.data">
790
  <xsl:param name="sep"/>
791
  <xsl:param name="datecit2">
792
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
793
  </xsl:param>
794
  <xsl:apply-templates mode="iso690.mode" select="./date[@role='upd']">
795
    <xsl:with-param name="sep"/>
796
  </xsl:apply-templates>
797
  <xsl:apply-templates mode="iso690.mode" select="./date[@role='cit']"/>
798
  <xsl:choose>
799
    <xsl:when test="./date[@role='cit']">
800
      <xsl:call-template name="iso690.endsep">
801
        <xsl:with-param name="text" select="$datecit2"/>
802
        <xsl:with-param name="sep" select="$sep"/>
803
      </xsl:call-template>
804
    </xsl:when>
805
    <xsl:when test="./date[@role='upd']">
806
      <xsl:call-template name="iso690.endsep">
807
        <xsl:with-param name="text" select="string(./date[@role='upd'])"/>
808
        <xsl:with-param name="sep" select="$sep"/>
809
      </xsl:call-template>
810
    </xsl:when>
811
  </xsl:choose>
812
</xsl:template>
813

    
814
<xsl:template match="publisher/address/city|publishername" mode="iso690.mode">
815
  <xsl:param name="sep"/>
816
  <xsl:param name="upd" select="0"/>
817
  <xsl:apply-templates mode="iso690.mode"/>
818
  <xsl:call-template name="iso690.endsep">
819
    <xsl:with-param name="text" select="string(.)"/>
820
    <xsl:with-param name="sep" select="$sep"/>
821
  </xsl:call-template>
822
</xsl:template>
823

    
824
<xsl:template match="pubdate|copyright/year" mode="iso690.mode">
825
  <xsl:param name="sep"/>
826
  <xsl:param name="upd" select="1"/>
827
  <xsl:param name="datecit2">
828
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
829
  </xsl:param>
830
  <xsl:variable name="substr" select="substring(string(.),string-length(string(.)))"/>
831
  <xsl:if test="name(.)!='pubdate'">
832
    <xsl:value-of select="'&#x00A9;'"/><!-- copyright -->
833
  </xsl:if>
834
  <xsl:apply-templates mode="iso690.mode"/>
835
  <xsl:call-template name="iso690.space">
836
    <xsl:with-param name="text" select="$substr"/>
837
  </xsl:call-template>
838
  <xsl:if test="$upd!=0">
839
    <xsl:choose>
840
      <xsl:when test="name(.)='pubdate'">
841
        <xsl:apply-templates mode="iso690.mode" select="../date[@role='upd']"/>
842
        <xsl:apply-templates mode="iso690.mode" select="../date[@role='cit']"/>
843
      </xsl:when>
844
      <xsl:otherwise>
845
        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='upd']"/>
846
        <xsl:apply-templates mode="iso690.mode" select="../../date[@role='cit']"/>
847
      </xsl:otherwise>
848
    </xsl:choose>
849
  </xsl:if>
850
  <xsl:choose>
851
    <xsl:when test="../date[@role='cit']|../../date[@role='cit'] and $upd!=0">
852
      <xsl:call-template name="iso690.endsep">
853
        <xsl:with-param name="text" select="$datecit2"/>
854
        <xsl:with-param name="sep" select="$sep"/>
855
      </xsl:call-template>
856
    </xsl:when>
857
    <xsl:when test="../date[@role='upd']|../../date[@role='upd'] and $upd!=0">
858
      <xsl:call-template name="iso690.endsep">
859
        <xsl:with-param name="text" select="string(../date[@role='upd'])"/>
860
        <xsl:with-param name="sep" select="$sep"/>
861
      </xsl:call-template>
862
    </xsl:when>
863
    <xsl:when test="$substr='-'">
864
      <xsl:call-template name="iso690.endsep">
865
        <xsl:with-param name="text" select="' '"/>
866
        <xsl:with-param name="sep" select="$sep"/>
867
      </xsl:call-template>
868
    </xsl:when>
869
    <xsl:otherwise>
870
      <xsl:call-template name="iso690.endsep">
871
        <xsl:with-param name="text" select="string(.)"/>
872
        <xsl:with-param name="sep" select="$sep"/>
873
      </xsl:call-template>
874
    </xsl:otherwise>
875
  </xsl:choose>
876
</xsl:template>
877

    
878
<xsl:template name="iso690.space">
879
  <xsl:param name="text" select="substring(string(.),string-length(string(.)))"/>
880
  <xsl:if test="$text='-'">
881
    <xsl:value-of select="' '"/>
882
  </xsl:if>
883
</xsl:template>
884

    
885
<!-- Date of update/revision -->
886
<xsl:template match="date[@role='upd']" mode="iso690.mode">
887
  <xsl:param name="sep">
888
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'upd.sep'"/></xsl:call-template>
889
  </xsl:param>
890
  <xsl:value-of select="$sep"/>
891
  <xsl:apply-templates mode="iso690.mode"/>
892
</xsl:template>
893

    
894
<!-- Date of citation -->
895
<xsl:template match="date[@role='cit']" mode="iso690.mode">
896
  <xsl:param name="datecit1">
897
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit1'"/></xsl:call-template>
898
  </xsl:param>
899
  <xsl:param name="datecit2">
900
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'datecit2'"/></xsl:call-template>
901
  </xsl:param>
902
  <xsl:value-of select="$datecit1"/>
903
  <xsl:apply-templates mode="iso690.mode"/>
904
  <xsl:value-of select="$datecit2"/>
905
</xsl:template>
906

    
907
<!-- Extent -->
908
<xsl:template name="iso690.extent">
909
  <xsl:param name="extent.sep">
910
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'extent.sep'"/></xsl:call-template>
911
  </xsl:param>
912
  <xsl:apply-templates mode="iso690.mode" select="./pagenums">
913
    <xsl:with-param name="sep" select="$extent.sep"/>
914
  </xsl:apply-templates>
915
</xsl:template>
916

    
917
<!-- Location within host -->
918
<xsl:template name="iso690.part.location">
919
  <xsl:param name="location.sep">
920
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
921
  </xsl:param>
922
  <xsl:choose>
923
    <xsl:when test="./pagenums">
924
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
925
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']"/>
926
      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
927
    </xsl:when>
928
    <xsl:when test="./bibliomisc[@role='sectitle']">
929
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']"/>
930
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='sectitle']">
931
        <xsl:with-param name="sep" select="$location.sep"/>
932
      </xsl:apply-templates>
933
    </xsl:when>
934
    <xsl:otherwise>
935
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='secnum']">
936
        <xsl:with-param name="sep" select="$location.sep"/>
937
      </xsl:apply-templates>
938
    </xsl:otherwise>
939
  </xsl:choose>
940
</xsl:template>
941

    
942
<xsl:template name="iso690.article.location">
943
  <xsl:param name="location.sep">
944
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
945
  </xsl:param>
946
  <xsl:param name="locs.sep">
947
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
948
  </xsl:param>
949
  <xsl:choose>
950
    <xsl:when test="not(./date[@role='upd']|./date[@role='cit'])">
951
      <xsl:choose>
952
        <xsl:when test="./volumenum|./issuenum|./pagenums">
953
          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
954
            <xsl:with-param name="upd" select="0"/>
955
            <xsl:with-param name="sep" select="$locs.sep"/>
956
          </xsl:apply-templates>
957
          <xsl:call-template name="iso690.location"/>
958
        </xsl:when>
959
        <xsl:otherwise>
960
          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
961
            <xsl:with-param name="sep" select="$location.sep"/>
962
          </xsl:apply-templates>
963
        </xsl:otherwise>
964
      </xsl:choose>
965
    </xsl:when>
966
    <xsl:otherwise>
967
      <xsl:choose>
968
        <xsl:when test="./volumenum|./issuenum|./pagenums">
969
          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
970
            <xsl:with-param name="upd" select="0"/>
971
            <xsl:with-param name="sep" select="$locs.sep"/>
972
          </xsl:apply-templates>
973
        </xsl:when>
974
        <xsl:otherwise>
975
          <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
976
            <xsl:with-param name="upd" select="0"/>
977
            <xsl:with-param name="sep" select="$location.sep"/>
978
          </xsl:apply-templates>
979
        </xsl:otherwise>
980
      </xsl:choose>
981
      <xsl:choose>
982
        <xsl:when test="./issuenum">
983
          <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
984
          <xsl:apply-templates mode="iso690.mode" select="./issuenum">
985
            <xsl:with-param name="sep"/>
986
          </xsl:apply-templates>
987
        </xsl:when>
988
        <xsl:otherwise>
989
          <xsl:apply-templates mode="iso690.mode" select="./volumenum">
990
            <xsl:with-param name="sep"/>
991
          </xsl:apply-templates>
992
        </xsl:otherwise>
993
      </xsl:choose>
994
      <xsl:choose>
995
        <xsl:when test="./pagenums">
996
          <xsl:call-template name="iso690.data">
997
            <xsl:with-param name="sep" select="$locs.sep"/>
998
          </xsl:call-template>
999
          <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
1000
        </xsl:when>
1001
        <xsl:otherwise>
1002
          <xsl:call-template name="iso690.data">
1003
            <xsl:with-param name="sep" select="$location.sep"/>
1004
          </xsl:call-template>
1005
        </xsl:otherwise>
1006
      </xsl:choose>
1007
    </xsl:otherwise>
1008
  </xsl:choose>
1009
</xsl:template>
1010

    
1011
<xsl:template name="iso690.location">
1012
  <xsl:param name="location.sep">
1013
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
1014
  </xsl:param>
1015
  <xsl:choose>
1016
    <xsl:when test="./volumenum and not(./issuenum) and not(./pagenums)">
1017
      <xsl:apply-templates mode="iso690.mode" select="./volumenum">
1018
        <xsl:with-param name="sep" select="$location.sep"/>
1019
      </xsl:apply-templates>
1020
    </xsl:when>
1021
    <xsl:when test="./issuenum and not(./pagenums)">
1022
      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
1023
      <xsl:apply-templates mode="iso690.mode" select="./issuenum">
1024
        <xsl:with-param name="sep" select="$location.sep"/>
1025
      </xsl:apply-templates>
1026
    </xsl:when>
1027
    <xsl:when test="./pagenums">
1028
      <xsl:apply-templates mode="iso690.mode" select="./volumenum"/>
1029
      <xsl:apply-templates mode="iso690.mode" select="./issuenum"/>
1030
      <xsl:apply-templates mode="iso690.mode" select="./pagenums"/>
1031
    </xsl:when>
1032
  </xsl:choose>
1033
</xsl:template>
1034

    
1035
<xsl:template match="bibliomisc[@role='secnum']|bibliomisc[@role='sectitle']" mode="iso690.mode">
1036
  <xsl:param name="sep">
1037
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
1038
  </xsl:param>
1039
  <xsl:apply-templates mode="iso690.mode"/>
1040
  <xsl:call-template name="iso690.endsep">
1041
    <xsl:with-param name="text" select="string(.)"/>
1042
    <xsl:with-param name="sep" select="$sep"/>
1043
  </xsl:call-template>
1044
</xsl:template>
1045

    
1046
<xsl:template match="volumenum|issuenum" mode="iso690.mode">
1047
  <xsl:param name="sep">
1048
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'locs.sep'"/></xsl:call-template>
1049
  </xsl:param>
1050
  <xsl:apply-templates mode="iso690.mode"/>
1051
  <xsl:call-template name="iso690.endsep">
1052
    <xsl:with-param name="text" select="string(.)"/>
1053
    <xsl:with-param name="sep" select="$sep"/>
1054
  </xsl:call-template>
1055
</xsl:template>
1056

    
1057
<xsl:template match="pagenums" mode="iso690.mode">
1058
  <xsl:param name="sep">
1059
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'location.sep'"/></xsl:call-template>
1060
  </xsl:param>
1061
  <xsl:apply-templates mode="iso690.mode"/>
1062
  <xsl:call-template name="iso690.endsep">
1063
    <xsl:with-param name="text" select="string(.)"/>
1064
    <xsl:with-param name="sep" select="$sep"/>
1065
  </xsl:call-template>
1066
</xsl:template>
1067

    
1068
<!-- Series -->
1069
<xsl:template name="iso690.serie">
1070
  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[@role='serie']"/>
1071
</xsl:template>
1072

    
1073
<!-- Notes -->
1074
<xsl:template name="iso690.notice">
1075
  <xsl:apply-templates mode="iso690.mode" select=".//bibliomisc[not(@role)]"/>
1076
</xsl:template>
1077

    
1078
<xsl:template match="bibliomisc[not(@role)]|bibliomisc[@role='serie']" mode="iso690.mode">
1079
  <xsl:param name="notice.sep">
1080
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'notice.sep'"/></xsl:call-template>
1081
  </xsl:param>
1082
  <xsl:apply-templates mode="iso690.mode"/>
1083
  <xsl:call-template name="iso690.endsep">
1084
    <xsl:with-param name="text" select="string(.)"/>
1085
    <xsl:with-param name="sep" select="$notice.sep"/>
1086
  </xsl:call-template>
1087
</xsl:template>
1088

    
1089
<!-- Avaibility and access -->
1090
<xsl:template name="iso690.access">
1091
  <xsl:for-each select="./biblioid[@class='uri']|./bibliomisc[@role='access']">
1092
    <xsl:choose>
1093
      <xsl:when test="position()=1">
1094
        <xsl:apply-templates mode="iso690.mode" select="."/>
1095
      </xsl:when>
1096
      <xsl:otherwise>
1097
        <xsl:apply-templates mode="iso690.mode" select=".">
1098
          <xsl:with-param name="firstacc" select="0"/>
1099
        </xsl:apply-templates>
1100
      </xsl:otherwise>
1101
    </xsl:choose>
1102
  </xsl:for-each>
1103
</xsl:template>
1104

    
1105
<xsl:template match="biblioid[@class='uri']/ulink|bibliomisc[@role='access']/ulink" mode="iso690.mode">
1106
  <xsl:param name="link1">
1107
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link1'"/></xsl:call-template>
1108
  </xsl:param>
1109
  <xsl:param name="link2">
1110
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'link2'"/></xsl:call-template>
1111
  </xsl:param>
1112
  <xsl:value-of select="$link1"/>
1113
  <xsl:call-template name="ulink"/>
1114
  <xsl:value-of select="$link2"/>
1115
</xsl:template>
1116

    
1117
<xsl:template match="biblioid[@class='uri']|bibliomisc[@role='access']" mode="iso690.mode">
1118
  <xsl:param name="firstacc" select="1"/>
1119
  <xsl:param name="access">
1120
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access'"/></xsl:call-template>
1121
  </xsl:param>
1122
  <xsl:param name="acctoo">
1123
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'acctoo'"/></xsl:call-template>
1124
  </xsl:param>
1125
  <xsl:param name="onwww">
1126
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'onwww'"/></xsl:call-template>
1127
  </xsl:param>
1128
  <xsl:param name="oninet">
1129
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'oninet'"/></xsl:call-template>
1130
  </xsl:param>
1131
  <xsl:param name="access.end">
1132
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.end'"/></xsl:call-template>
1133
  </xsl:param>
1134
  <xsl:param name="access.sep">
1135
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'access.sep'"/></xsl:call-template>
1136
  </xsl:param>
1137
  <xsl:choose>
1138
    <xsl:when test="$firstacc=1">
1139
      <xsl:value-of select="$access"/>
1140
    </xsl:when>
1141
    <xsl:otherwise>
1142
      <xsl:value-of select="$acctoo"/>
1143
    </xsl:otherwise>
1144
  </xsl:choose>
1145
  <xsl:choose>
1146
    <xsl:when test="(./ulink)and(string(./ulink)=string(.))">
1147
      <xsl:choose>
1148
        <xsl:when test="(starts-with(./ulink/@url,'http://')or(starts-with(./ulink/@url,'https://')))">
1149
          <xsl:value-of select="$onwww"/>
1150
          <xsl:value-of select="$access.end"/>
1151
          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
1152
        </xsl:when>
1153
        <xsl:otherwise>
1154
          <xsl:value-of select="$oninet"/>
1155
          <xsl:value-of select="$access.end"/>
1156
          <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
1157
        </xsl:otherwise>
1158
      </xsl:choose>
1159
    </xsl:when>
1160
    <xsl:when test="(./ulink)and(string(./ulink)!=string(.))">
1161
      <xsl:value-of select="text()[1]"/>
1162
      <xsl:call-template name="iso690.endsep">
1163
        <xsl:with-param name="text" select="text()[1]"/>
1164
        <xsl:with-param name="sep" select="$access.end"/>
1165
      </xsl:call-template>
1166
      <xsl:apply-templates mode="iso690.mode" select="./ulink"/>
1167
    </xsl:when>
1168
    <xsl:otherwise>
1169
      <xsl:apply-templates mode="iso690.mode"/>
1170
    </xsl:otherwise>
1171
  </xsl:choose>
1172
  <xsl:value-of select="$access.sep"/>
1173
</xsl:template>
1174

    
1175
<!-- Standard number - ISBN -->
1176
<xsl:template name="iso690.isbn">
1177
  <xsl:choose>
1178
    <xsl:when test="./biblioid/@class='isbn'">
1179
      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='isbn']"/>
1180
    </xsl:when>
1181
    <xsl:when test="./isbn">
1182
      <xsl:apply-templates mode="iso690.mode" select="./isbn"/>
1183
    </xsl:when>
1184
  </xsl:choose>
1185
</xsl:template>
1186

    
1187
<xsl:template match="isbn|biblioid[@class='isbn']" mode="iso690.mode">
1188
  <xsl:param name="isbn">
1189
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'isbn'"/></xsl:call-template>
1190
  </xsl:param>
1191
  <xsl:param name="stdnum.sep">
1192
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
1193
  </xsl:param>
1194
  <xsl:value-of select="$isbn"/>
1195
  <xsl:apply-templates mode="iso690.mode"/>
1196
  <xsl:value-of select="$stdnum.sep"/>
1197
</xsl:template>
1198

    
1199
<!-- Standard number - ISSN -->
1200
<xsl:template name="iso690.issn">
1201
  <xsl:choose>
1202
    <xsl:when test="./biblioid/@class='issn'">
1203
      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='issn']"/>
1204
    </xsl:when>
1205
    <xsl:when test="./issn">
1206
      <xsl:apply-templates mode="iso690.mode" select="./issn"/>
1207
    </xsl:when>
1208
  </xsl:choose>
1209
</xsl:template>
1210

    
1211
<xsl:template match="issn|biblioid[@class='issn']" mode="iso690.mode">
1212
  <xsl:param name="issn">
1213
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'issn'"/></xsl:call-template>
1214
  </xsl:param>
1215
  <xsl:param name="stdnum.sep">
1216
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'stdnum.sep'"/></xsl:call-template>
1217
  </xsl:param>
1218
  <xsl:value-of select="$issn"/>
1219
  <xsl:apply-templates mode="iso690.mode"/>
1220
  <xsl:value-of select="$stdnum.sep"/>
1221
</xsl:template>
1222

    
1223
<!-- Identification of patent document -->
1224
<xsl:template name="iso690.pat.ident">
1225
  <xsl:param name="patdate.sep">
1226
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patdate.sep'"/></xsl:call-template>
1227
  </xsl:param>
1228
  <xsl:apply-templates mode="iso690.mode" select="./address/country"/>
1229
  <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patenttype']"/>
1230
  <xsl:choose>
1231
    <xsl:when test="./biblioid[@class='other' and @otherclass='patentnum']">
1232
      <xsl:apply-templates mode="iso690.mode" select="./biblioid[@class='other' and @otherclass='patentnum']"/>
1233
    </xsl:when>
1234
    <xsl:otherwise>
1235
      <xsl:apply-templates mode="iso690.mode" select="./bibliomisc[@role='patentnum']"/>
1236
    </xsl:otherwise>
1237
  </xsl:choose>
1238
  <xsl:apply-templates mode="iso690.mode" select="./pubdate[not(@role='issuing')]">
1239
    <xsl:with-param name="sep" select="$patdate.sep"/>
1240
  </xsl:apply-templates>
1241
</xsl:template>
1242

    
1243
<!-- Country or issuing office -->
1244
<xsl:template match="address/country" mode="iso690.mode">
1245
  <xsl:param name="patcountry.sep">
1246
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patcountry.sep'"/></xsl:call-template>
1247
  </xsl:param>
1248
  <i>
1249
    <xsl:apply-templates mode="iso690.mode"/>
1250
  </i>
1251
  <xsl:value-of select="$patcountry.sep"/>
1252
</xsl:template>
1253

    
1254
<!-- Kind of patent document -->
1255
<xsl:template match="bibliomisc[@role='patenttype']" mode="iso690.mode">
1256
  <xsl:param name="pattype.sep">
1257
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'pattype.sep'"/></xsl:call-template>
1258
  </xsl:param>
1259
  <i>
1260
    <xsl:apply-templates mode="iso690.mode"/>
1261
  </i>
1262
  <xsl:value-of select="$pattype.sep"/>
1263
</xsl:template>
1264

    
1265
<!-- Number -->
1266
<xsl:template match="biblioid[@class='other' and @otherclass='patentnum']|bibliomisc[@role='patentnum']" mode="iso690.mode">
1267
  <xsl:param name="patnum.sep">
1268
    <xsl:call-template name="gentext.template"><xsl:with-param name="context" select="'iso690'"/><xsl:with-param name="name" select="'patnum.sep'"/></xsl:call-template>
1269
  </xsl:param>
1270
  <xsl:apply-templates mode="iso690.mode"/>
1271
  <xsl:value-of select="$patnum.sep"/>
1272
</xsl:template>
1273

    
1274
<!-- ==================================================================== -->
1275
<!-- Supplementary templates -->
1276

    
1277
<xsl:template name="iso690.endsep">
1278
  <xsl:param name="text"/>
1279
  <xsl:param name="sep" select=". "/>
1280
  <xsl:choose>
1281
    <xsl:when test="substring($text,string-length($text))!=substring($sep,1,1)">
1282
      <xsl:value-of select="$sep"/>
1283
    </xsl:when>
1284
    <xsl:when test="substring($text,string-length($text))=' '">
1285
    </xsl:when>
1286
    <xsl:otherwise>
1287
      <xsl:value-of select="' '"/>
1288
    </xsl:otherwise>
1289
  </xsl:choose>
1290
</xsl:template>
1291

    
1292
<!-- ==================================================================== -->
1293

    
1294
<xsl:template match="*" mode="iso690.mode">
1295
  <xsl:apply-templates select="."/><!-- try the default mode -->
1296
</xsl:template>
1297

    
1298
<!-- ==================================================================== -->
1299

    
1300
</xsl:stylesheet>
(5-5/39)