metanorma-iho 0.1.1 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  require "isodoc"
2
2
  require "isodoc/generic/html_convert"
3
- require "isodoc/iho/metadata"
3
+ require_relative "init"
4
4
 
5
5
  module IsoDoc
6
6
  module IHO
@@ -13,20 +13,22 @@ module IsoDoc
13
13
  end
14
14
 
15
15
  def make_body3(body, docxml)
16
- body.div **{ class: "main-section" } do |div3|
17
- boilerplate docxml, div3
18
- abstract docxml, div3
19
- foreword docxml, div3
20
- introduction docxml, div3
21
- preface docxml, div3
22
- acknowledgements docxml, div3
23
- middle docxml, div3
24
- footnotes div3
25
- comments div3
16
+ body.div **{ class: "main-section" } do |div3|
17
+ boilerplate docxml, div3
18
+ preface_block docxml, div3
19
+ abstract docxml, div3
20
+ foreword docxml, div3
21
+ introduction docxml, div3
22
+ preface docxml, div3
23
+ acknowledgements docxml, div3
24
+ middle docxml, div3
25
+ footnotes div3
26
+ comments div3
27
+ end
26
28
  end
27
- end
28
29
 
29
30
  include BaseConvert
31
+ include Init
30
32
  end
31
33
  end
32
34
  end
@@ -0,0 +1,2 @@
1
+ clause: Chapter
2
+ subclause: Section
@@ -7,7 +7,8 @@
7
7
 
8
8
 
9
9
 
10
- <xsl:key name="kfn" match="iho:fn[local-name(..) = 'p' or local-name(..) = 'title']" use="@reference"/>
10
+ <!-- <xsl:key name="kfn" match="iho:fn[local-name(..) = 'p' or local-name(..) = 'title']" use="@reference"/> -->
11
+ <xsl:key name="kfn" match="iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']]" use="@reference"/>
11
12
 
12
13
 
13
14
 
@@ -29,27 +30,8 @@
29
30
  -->
30
31
  <xsl:variable name="contents">
31
32
  <contents>
32
- <xsl:apply-templates select="/iho:iho-standard/iho:preface/*" mode="contents"/>
33
- <!-- <xsl:with-param name="sectionNum" select="'0'"/>
34
- </xsl:apply-templates> -->
35
- <xsl:apply-templates select="/iho:iho-standard/iho:sections/*" mode="contents"> <!-- iho:clause[1] [@id = '_scope'] -->
36
- <!-- <xsl:with-param name="sectionNum" select="'1'"/> -->
37
- </xsl:apply-templates>
38
- <!-- [@id = '_normative_references'] -->
39
- <!-- <xsl:apply-templates select="/iho:iho-standard/iho:bibliography/iho:references[1]" mode="contents">
40
- <xsl:with-param name="sectionNum" select="'2'"/>
41
- </xsl:apply-templates> -->
42
- <!-- @id != '_scope' -->
43
- <!-- <xsl:apply-templates select="/iho:iho-standard/iho:sections/*[position() &gt; 1]" mode="contents">
44
- <xsl:with-param name="sectionNumSkew" select="'1'"/>
45
- </xsl:apply-templates> -->
46
- <xsl:apply-templates select="/iho:iho-standard/iho:annex" mode="contents"/>
47
- <xsl:apply-templates select="/iho:iho-standard/iho:bibliography/iho:references[position() &gt; 1]" mode="contents"/> <!-- @id = '_bibliography' -->
48
-
49
- <xsl:apply-templates select="//iho:figure" mode="contents"/>
50
-
51
- <xsl:apply-templates select="//iho:table" mode="contents"/>
52
-
33
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
34
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
53
35
  </contents>
54
36
  </xsl:variable>
55
37
 
@@ -235,7 +217,7 @@
235
217
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
236
218
  </xsl:if>
237
219
 
238
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
220
+ <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
239
221
  <fo:block>
240
222
  <xsl:if test="@level = 1">
241
223
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -243,21 +225,18 @@
243
225
 
244
226
  <fo:list-block>
245
227
 
246
-
247
-
248
228
  <xsl:attribute name="provisional-distance-between-starts">
249
229
  <xsl:choose>
250
- <xsl:when test="@level &gt;= 1 and @display-section = 'true' and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
251
- <xsl:when test="@level &gt;= 1 and @display-section = 'true' and not(@type = 'annex')">10mm</xsl:when>
252
- <!-- <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.2"/>mm</xsl:when>
253
- <xsl:when test="@section != '' and not(@display-section = 'false')"><xsl:value-of select="$margin-left"/>mm</xsl:when> -->
230
+ <xsl:when test="@level &gt;= 1 and @root = 'preface'">0mm</xsl:when>
231
+ <xsl:when test="@level &gt;= 1 and @root = 'annex' and not(@type = 'annex')">13mm</xsl:when>
232
+ <xsl:when test="@level &gt;= 1 and not(@type = 'annex')">10mm</xsl:when>
254
233
  <xsl:otherwise>0mm</xsl:otherwise>
255
234
  </xsl:choose>
256
235
  </xsl:attribute>
257
236
  <fo:list-item>
258
237
  <fo:list-item-label end-indent="label-end()">
259
238
  <fo:block>
260
- <xsl:if test="@section and not(@display-section = 'false') and not(@type = 'annex')"> <!-- output below -->
239
+ <xsl:if test="@section != '' and not(@type = 'annex')"> <!-- output below -->
261
240
  <xsl:value-of select="@section"/>
262
241
  </xsl:if>
263
242
  </fo:block>
@@ -265,13 +244,7 @@
265
244
  <fo:list-item-body start-indent="body-start()">
266
245
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
267
246
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
268
- <fo:inline>
269
- <xsl:if test="@type = 'annex'">
270
- <xsl:attribute name="font-weight">bold</xsl:attribute>
271
- <xsl:value-of select="@section"/><xsl:text>  </xsl:text>
272
- </xsl:if>
273
- <xsl:value-of select="text()"/>
274
- </fo:inline>
247
+ <xsl:apply-templates/>
275
248
  <fo:inline keep-together.within-line="always">
276
249
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
277
250
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -288,7 +261,7 @@
288
261
  </fo:block-container>
289
262
 
290
263
  <!-- Foreword, Introduction -->
291
- <xsl:apply-templates select="/iho:iho-standard/iho:preface/*"/>
264
+ <xsl:call-template name="processPrefaceSectionsDefault"/>
292
265
 
293
266
  </fo:flow>
294
267
  </fo:page-sequence>
@@ -313,9 +286,13 @@
313
286
 
314
287
  <fo:block font-size="16pt" font-weight="bold" margin-bottom="18pt"><xsl:value-of select="$title-en"/></fo:block>
315
288
 
316
- <xsl:apply-templates select="/iho:iho-standard/iho:sections/*"/>
317
-
318
-
289
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
290
+ <!-- Normative references -->
291
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
292
+ <!-- Terms and definitions -->
293
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms']"/>
294
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='definitions']"/>
295
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope')]"/>
319
296
 
320
297
  </fo:block-container>
321
298
  </fo:flow>
@@ -330,12 +307,32 @@
330
307
  </fo:static-content>
331
308
  <xsl:call-template name="insertHeaderFooter"/>
332
309
  <fo:flow flow-name="xsl-region-body">
333
- <fo:block-container>
334
- <xsl:apply-templates select="/iho:iho-standard/iho:annex"/>
310
+ <fo:block-container>
311
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
312
+ </fo:block-container>
313
+ </fo:flow>
314
+ </fo:page-sequence>
315
+ </xsl:if>
316
+
317
+ <xsl:if test="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]">
318
+ <fo:page-sequence master-reference="document">
319
+ <fo:static-content flow-name="xsl-footnote-separator">
320
+ <fo:block>
321
+ <fo:leader leader-pattern="rule" leader-length="30%"/>
322
+ </fo:block>
323
+ </fo:static-content>
324
+ <xsl:call-template name="insertHeaderFooter"/>
325
+ <fo:flow flow-name="xsl-region-body">
326
+ <fo:block-container>
327
+ <!-- Bibliography -->
328
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
335
329
  </fo:block-container>
336
330
  </fo:flow>
337
331
  </fo:page-sequence>
338
332
  </xsl:if>
333
+
334
+
335
+
339
336
  <!-- =========================== -->
340
337
  <!-- End Document Pages -->
341
338
  <!-- =========================== -->
@@ -351,194 +348,54 @@
351
348
  <!-- ============================= -->
352
349
  <!-- CONTENTS -->
353
350
  <!-- ============================= -->
354
- <xsl:template match="node()" mode="contents">
355
- <xsl:param name="sectionNum"/>
356
- <xsl:param name="sectionNumSkew"/>
357
- <xsl:apply-templates mode="contents">
358
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
359
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
360
- </xsl:apply-templates>
361
- </xsl:template>
362
-
363
- <!-- calculate main section number (1,2,3) and pass it deep into templates -->
364
- <!-- it's necessary, because there is itu:bibliography/itu:references from other section, but numbering should be sequental -->
365
- <xsl:template match="iho:iho-standard/iho:sections/*" mode="contents">
366
- <xsl:param name="sectionNum"/>
367
- <xsl:param name="sectionNumSkew" select="0"/>
368
- <xsl:variable name="sectionNum_">
369
- <xsl:choose>
370
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
371
- <xsl:when test="$sectionNumSkew != 0">
372
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable>
373
- <xsl:value-of select="$number + $sectionNumSkew"/>
374
- </xsl:when>
375
- <xsl:otherwise>
376
- <xsl:number count="*"/>
377
- </xsl:otherwise>
378
- </xsl:choose>
379
- </xsl:variable>
380
- <xsl:apply-templates mode="contents">
381
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
382
- </xsl:apply-templates>
383
- </xsl:template>
384
-
385
- <xsl:template match="iho:annex" mode="contents">
386
- <xsl:param name="sectionNum"/>
387
- <xsl:variable name="id" select="@id"/>
388
- <xsl:variable name="level">1</xsl:variable>
389
- <xsl:variable name="section">
390
- <xsl:choose>
391
- <xsl:when test="@obligation = 'informative'">
392
- <xsl:variable name="title-appendix">
393
- <xsl:call-template name="getTitle">
394
- <xsl:with-param name="name" select="'title-appendix'"/>
395
- </xsl:call-template>
396
- </xsl:variable>
397
- <xsl:value-of select="$title-appendix"/>
398
- <xsl:number format="1" level="any" count="iho:annex[@obligation = 'informative']"/>
399
- </xsl:when>
400
- <xsl:otherwise>
401
- <xsl:variable name="title-annex">
402
- <xsl:call-template name="getTitle">
403
- <xsl:with-param name="name" select="'title-annex'"/>
404
- </xsl:call-template>
405
- </xsl:variable>
406
- <xsl:value-of select="$title-annex"/>
407
- <xsl:number format="A" level="any" count="iho:annex[not(@obligation = 'informative')]"/>
408
- </xsl:otherwise>
409
- </xsl:choose>
410
- </xsl:variable>
411
- <xsl:variable name="display">true</xsl:variable>
412
- <xsl:variable name="display-section">true</xsl:variable>
413
- <xsl:variable name="type"><xsl:value-of select="local-name()"/></xsl:variable>
414
- <xsl:variable name="root">annex</xsl:variable>
415
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
416
- <xsl:attribute name="addon">
417
- <xsl:value-of select="../@obligation"/>
418
- </xsl:attribute>
419
- <xsl:value-of select="iho:title"/>
420
- </item>
421
- <xsl:apply-templates mode="contents">
422
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
423
- </xsl:apply-templates>
351
+ <xsl:template match="node()" mode="contents">
352
+ <xsl:apply-templates mode="contents"/>
424
353
  </xsl:template>
425
354
 
426
-
427
- <!-- Any node with title element - clause, definition,... except annex ! (see processing above) -->
428
- <xsl:template match="iho:title[not(parent::iho:annex)] | iho:preferred" mode="contents">
429
- <xsl:param name="sectionNum"/>
430
-
431
- <xsl:variable name="id">
432
- <xsl:call-template name="getId"/>
433
- </xsl:variable>
434
-
355
+ <!-- element with title -->
356
+ <xsl:template match="*[iho:title]" mode="contents">
435
357
  <xsl:variable name="level">
436
- <xsl:call-template name="getLevel"/>
437
- </xsl:variable>
438
-
439
- <xsl:variable name="section">
440
- <xsl:call-template name="getSection">
441
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
358
+ <xsl:call-template name="getLevel">
359
+ <xsl:with-param name="depth" select="iho:title/@depth"/>
442
360
  </xsl:call-template>
443
361
  </xsl:variable>
444
362
 
445
363
  <xsl:variable name="display">
446
364
  <xsl:choose>
447
- <xsl:when test="ancestor::iho:bibitem">false</xsl:when>
448
- <xsl:when test="ancestor::iho:term">false</xsl:when>
449
- <xsl:when test="ancestor::iho:annex and $level &gt;= 3">false</xsl:when>
365
+ <xsl:when test="ancestor-or-self::iho:bibitem">false</xsl:when>
366
+ <xsl:when test="ancestor-or-self::iho:term">false</xsl:when>
450
367
  <xsl:when test="$level &lt;= 2">true</xsl:when>
451
368
  <xsl:otherwise>false</xsl:otherwise>
452
369
  </xsl:choose>
453
370
  </xsl:variable>
454
371
 
455
- <xsl:variable name="display-section">
456
- <xsl:choose>
457
- <xsl:when test="ancestor::iho:preface">false</xsl:when>
458
- <!-- <xsl:when test="ancestor::iho:annex">false</xsl:when> -->
459
- <xsl:otherwise>true</xsl:otherwise>
460
- </xsl:choose>
461
- </xsl:variable>
462
-
463
- <xsl:variable name="type">
464
- <xsl:value-of select="local-name(..)"/>
465
- </xsl:variable>
466
-
467
- <xsl:variable name="root">
468
- <xsl:choose>
469
- <xsl:when test="ancestor::iho:annex">annex</xsl:when>
470
- </xsl:choose>
471
- </xsl:variable>
372
+ <xsl:if test="$display = 'true'">
472
373
 
473
- <item id="{$id}" level="{$level}" section="{$section}" display-section="{$display-section}" display="{$display}" type="{$type}" root="{$root}">
474
- <xsl:attribute name="addon">
475
- <xsl:if test="local-name(..) = 'annex'"><xsl:value-of select="../@obligation"/></xsl:if>
476
- </xsl:attribute>
477
- <xsl:value-of select="."/>
478
- </item>
374
+ <xsl:variable name="section">
375
+ <xsl:call-template name="getSection"/>
376
+ </xsl:variable>
377
+
378
+ <xsl:variable name="title">
379
+ <xsl:call-template name="getName"/>
380
+ </xsl:variable>
381
+
382
+ <xsl:variable name="type">
383
+ <xsl:value-of select="local-name()"/>
384
+ </xsl:variable>
385
+
386
+ <xsl:variable name="root">
387
+ <xsl:if test="ancestor-or-self::iho:preface">preface</xsl:if>
388
+ <xsl:if test="ancestor-or-self::iho:annex">annex</xsl:if>
389
+ </xsl:variable>
390
+
391
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
392
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
393
+ </item>
394
+ <xsl:apply-templates mode="contents"/>
395
+ </xsl:if>
479
396
 
480
- <xsl:apply-templates mode="contents">
481
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
482
- </xsl:apply-templates>
483
- </xsl:template>
484
-
485
-
486
- <xsl:template match="iho:figure" mode="contents">
487
- <item level="" id="{@id}" display="false">
488
- <xsl:attribute name="section">
489
- <xsl:call-template name="getFigureNumber"/>
490
- </xsl:attribute>
491
- </item>
492
- </xsl:template>
493
-
494
- <xsl:template match="iho:table" mode="contents">
495
- <xsl:param name="sectionNum"/>
496
- <xsl:variable name="annex-id" select="ancestor::iho:annex/@id"/>
497
- <item level="" id="{@id}" display="false" type="table">
498
- <xsl:attribute name="section">
499
- <xsl:variable name="title-table">
500
- <xsl:call-template name="getTitle">
501
- <xsl:with-param name="name" select="'title-table'"/>
502
- </xsl:call-template>
503
- </xsl:variable>
504
- <xsl:value-of select="$title-table"/>
505
- <xsl:call-template name="getTableNumber"/>
506
- </xsl:attribute>
507
- <xsl:value-of select="iho:name/text()"/>
508
- </item>
509
- </xsl:template>
510
-
511
- <xsl:template match="iho:formula" mode="contents">
512
- <item level="" id="{@id}" display="false">
513
- <xsl:attribute name="section">
514
- <xsl:variable name="title-formula">
515
- <xsl:call-template name="getTitle">
516
- <xsl:with-param name="name" select="'title-formula'"/>
517
- </xsl:call-template>
518
- </xsl:variable>
519
- <xsl:value-of select="$title-formula"/><xsl:number format="(A.1)" level="multiple" count="iho:annex | iho:formula"/>
520
- </xsl:attribute>
521
- </item>
522
397
  </xsl:template>
523
398
 
524
- <xsl:template match="iho:li" mode="contents">
525
- <xsl:param name="sectionNum"/>
526
- <item level="" id="{@id}" display="false" type="li">
527
- <xsl:attribute name="section">
528
- <xsl:call-template name="getListItemFormat"/>
529
- </xsl:attribute>
530
- <xsl:attribute name="parent_section">
531
- <xsl:for-each select="ancestor::*[not(local-name() = 'p' or local-name() = 'ol')][1]">
532
- <xsl:call-template name="getSection">
533
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
534
- </xsl:call-template>
535
- </xsl:for-each>
536
- </xsl:attribute>
537
- </item>
538
- <xsl:apply-templates mode="contents">
539
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
540
- </xsl:apply-templates>
541
- </xsl:template>
542
399
 
543
400
  <xsl:template match="iho:references/iho:bibitem" mode="contents"/>
544
401
  <!-- ============================= -->
@@ -564,110 +421,38 @@
564
421
  </xsl:template>
565
422
 
566
423
 
567
- <!-- for pass the paremeter 'sectionNum' over templates, like 'tunnel' parameter in XSLT 2.0 -->
568
- <xsl:template match="node()">
569
- <xsl:param name="sectionNum"/>
570
- <xsl:param name="sectionNumSkew"/>
571
- <xsl:apply-templates>
572
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
573
- <xsl:with-param name="sectionNumSkew" select="$sectionNumSkew"/>
574
- </xsl:apply-templates>
575
- </xsl:template>
576
-
577
- <!-- clause, terms, clause, ...-->
578
- <xsl:template match="iho:iho-standard/iho:sections/*">
579
- <xsl:param name="sectionNum"/>
580
- <xsl:param name="sectionNumSkew" select="0"/>
581
- <fo:block>
582
- <!-- iho:sections/iho:clause | iho:sections/iho:terms | iho:sections/iho:definitions -->
583
- <!-- <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
584
- <xsl:if test="$pos &gt;= 2">
585
- <xsl:attribute name="space-before">18pt</xsl:attribute>
586
- </xsl:if> -->
587
- <!-- pos=<xsl:value-of select="$pos" /> -->
588
- <xsl:variable name="sectionNum_">
589
- <xsl:choose>
590
- <xsl:when test="$sectionNum"><xsl:value-of select="$sectionNum"/></xsl:when>
591
- <xsl:when test="$sectionNumSkew != 0">
592
- <xsl:variable name="number"><xsl:number count="*"/></xsl:variable> <!--iho:sections/iho:clause | iho:sections/iho:terms | iho:sections/iho:definitions -->
593
- <xsl:value-of select="$number + $sectionNumSkew"/>
594
- </xsl:when>
595
- <xsl:otherwise>
596
- <xsl:number count="*"/>
597
- </xsl:otherwise>
598
- </xsl:choose>
599
- </xsl:variable>
600
- <!-- <xsl:if test="not(iho:title)">
601
- <fo:block margin-top="3pt" margin-bottom="12pt">
602
- <xsl:value-of select="$sectionNum_"/><xsl:number format=".1 " level="multiple" count="iho:clause" />
603
- </fo:block>
604
- </xsl:if> -->
605
- <xsl:apply-templates>
606
- <xsl:with-param name="sectionNum" select="$sectionNum_"/>
607
- </xsl:apply-templates>
608
- </fo:block>
424
+ <xsl:template match="node()">
425
+ <xsl:apply-templates/>
609
426
  </xsl:template>
610
427
 
428
+
429
+ <!-- ====== -->
430
+ <!-- title -->
431
+ <!-- ====== -->
611
432
 
612
- <!-- Foreword, Introduction -->
613
- <xsl:template match="iho:iho-standard/iho:preface/*">
614
- <fo:block break-after="page"/>
615
- <xsl:apply-templates/>
433
+ <xsl:template match="iho:annex/iho:title">
434
+ <fo:block font-size="13pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always">
435
+ <xsl:apply-templates/>
436
+ </fo:block>
616
437
  </xsl:template>
617
-
618
- <xsl:template match="iho:clause//iho:clause[not(iho:title)]">
619
- <xsl:param name="sectionNum"/>
620
- <xsl:variable name="section">
621
- <xsl:call-template name="getSection">
622
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
623
- </xsl:call-template>
624
- </xsl:variable>
625
438
 
626
- <fo:block margin-top="3pt"><!-- margin-bottom="6pt" -->
627
- <fo:inline font-weight="bold" padding-right="3mm">
628
- <xsl:value-of select="$section"/><!-- <xsl:number format=".1 " level="multiple" count="iho:clause/iho:clause" /> -->
629
- </fo:inline>
630
- <xsl:apply-templates>
631
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
632
- <xsl:with-param name="inline" select="'true'"/>
633
- </xsl:apply-templates>
439
+ <xsl:template match="iho:bibliography/iho:references[not(@normative='true')]/iho:title">
440
+ <fo:block font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always">
441
+ <xsl:apply-templates/>
634
442
  </fo:block>
635
443
  </xsl:template>
636
-
637
-
638
444
 
639
445
  <xsl:template match="iho:title">
640
- <xsl:param name="sectionNum"/>
641
-
642
- <xsl:variable name="parent-name" select="local-name(..)"/>
643
- <xsl:variable name="references_num_current">
644
- <xsl:number level="any" count="iho:references"/>
645
- </xsl:variable>
646
-
647
- <xsl:variable name="id">
648
- <xsl:call-template name="getId"/>
649
- </xsl:variable>
650
446
 
651
447
  <xsl:variable name="level">
652
448
  <xsl:call-template name="getLevel"/>
653
449
  </xsl:variable>
654
-
655
- <xsl:variable name="section">
656
- <xsl:call-template name="getSection">
657
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
658
- </xsl:call-template>
659
- </xsl:variable>
660
-
450
+
661
451
  <xsl:variable name="font-size">
662
452
  <xsl:choose>
663
453
  <xsl:when test="$level = 1">13pt</xsl:when>
664
454
  <xsl:when test="$level = 2">12pt</xsl:when>
665
- <xsl:when test="$level &gt;= 3">11pt</xsl:when>
666
- <!-- <xsl:when test="ancestor::iho:annex and $level = 2">13pt</xsl:when>
667
- <xsl:when test="ancestor::iho:annex and $level = 3">12pt</xsl:when>
668
- <xsl:when test="ancestor::iho:preface">16pt</xsl:when>
669
- <xsl:when test="$level = 2">12pt</xsl:when>
670
- <xsl:when test="$level &gt;= 3">11pt</xsl:when> -->
455
+ <xsl:when test="$level &gt;= 3">11pt</xsl:when>
671
456
  <xsl:otherwise>12pt</xsl:otherwise>
672
457
  </xsl:choose>
673
458
  </xsl:variable>
@@ -679,75 +464,37 @@
679
464
  </xsl:choose>
680
465
  </xsl:variable>
681
466
 
682
- <xsl:choose>
683
- <xsl:when test="$parent-name = 'annex'">
684
- <fo:block id="{$id}" font-size="13pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always">
685
- <xsl:value-of select="$section"/>
686
- <xsl:value-of select="$linebreak"/>
687
- <!-- <xsl:if test=" ../@obligation">
688
- <xsl:value-of select="$linebreak"/>
689
- <fo:inline font-weight="normal">(<xsl:value-of select="../@obligation"/>)</fo:inline>
690
- </xsl:if> -->
691
- <xsl:apply-templates/>
692
- </fo:block>
693
- </xsl:when>
694
- <xsl:when test="$parent-name = 'references' and $references_num_current != 1"> <!-- Bibliography -->
695
- <fo:block id="{$id}" font-size="16pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="36pt" keep-with-next="always">
696
- <xsl:apply-templates/>
697
- </fo:block>
698
- </xsl:when>
699
-
700
- <xsl:otherwise>
701
- <xsl:element name="{$element-name}">
702
- <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
703
- <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
704
- <!-- <xsl:attribute name="font-weight">bold</xsl:attribute> -->
705
- <xsl:attribute name="space-before"> <!-- margin-top -->
706
- <xsl:choose>
707
- <xsl:when test="$level = 1">13.5pt</xsl:when>
708
- <xsl:when test="$level &gt;= 2">3pt</xsl:when>
709
- <xsl:when test="ancestor::iho:preface">8pt</xsl:when>
710
- <xsl:when test="$level = 2 and ancestor::iho:annex">18pt</xsl:when>
711
- <xsl:when test="$level = 1">18pt</xsl:when>
712
- <xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
713
- <xsl:otherwise>12pt</xsl:otherwise>
714
- </xsl:choose>
715
- </xsl:attribute>
716
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
717
-
718
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
719
-
720
-
721
- <!-- DEBUG level=<xsl:value-of select="$level"/>x -->
722
- <!-- section=<xsl:value-of select="$sectionNum"/> -->
723
- <!-- <xsl:if test="$sectionNum"> -->
724
- <xsl:value-of select="$section"/>
725
- <xsl:if test="$section != ''">
726
- <xsl:choose>
727
- <xsl:when test="$level = 2">
728
- <fo:inline padding-right="2mm"> </fo:inline>
729
- </xsl:when>
730
- <xsl:when test="$level = 3">
731
- <fo:inline padding-right="2mm"> </fo:inline>
732
- </xsl:when>
733
- <xsl:otherwise>
734
- <fo:inline padding-right="3mm"> </fo:inline>
735
- </xsl:otherwise>
736
- </xsl:choose>
737
- </xsl:if>
738
-
739
- <xsl:apply-templates/>
740
- </xsl:element>
467
+
468
+ <xsl:element name="{$element-name}">
469
+ <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
470
+ <xsl:attribute name="space-before">
471
+ <xsl:choose>
472
+ <xsl:when test="$level = 1">13.5pt</xsl:when>
473
+ <xsl:when test="$level &gt;= 2">3pt</xsl:when>
474
+ <xsl:when test="ancestor::iho:preface">8pt</xsl:when>
475
+ <xsl:when test="$level = 2 and ancestor::iho:annex">18pt</xsl:when>
476
+ <xsl:when test="$level = 1">18pt</xsl:when>
477
+ <xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
478
+ <xsl:otherwise>12pt</xsl:otherwise>
479
+ </xsl:choose>
480
+ </xsl:attribute>
481
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
741
482
 
742
- <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iho:p)">
743
- <fo:block> <!-- margin-bottom="12pt" -->
744
- <xsl:value-of select="$linebreak"/>
745
- </fo:block>
746
- </xsl:if>
747
- </xsl:otherwise>
748
- </xsl:choose>
483
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
484
+
485
+ <xsl:apply-templates/>
486
+ </xsl:element>
487
+
488
+ <xsl:if test="$element-name = 'fo:inline' and not(following-sibling::iho:p)">
489
+ <fo:block> <!-- margin-bottom="12pt" -->
490
+ <xsl:value-of select="$linebreak"/>
491
+ </fo:block>
492
+ </xsl:if>
749
493
 
750
494
  </xsl:template>
495
+ <!-- ====== -->
496
+ <!-- ====== -->
497
+
751
498
 
752
499
  <xsl:template match="iho:p">
753
500
  <xsl:param name="inline" select="'false'"/>
@@ -808,7 +555,7 @@
808
555
 
809
556
  <xsl:variable name="p_fn">
810
557
  <!-- <xsl:for-each select="//iho:p/iho:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]"> -->
811
- <xsl:for-each select="//iho:fn[local-name(..) = 'p' or local-name(..) = 'title'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
558
+ <xsl:for-each select="//iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
812
559
  <!-- copy unique fn -->
813
560
  <fn gen_id="{generate-id(.)}">
814
561
  <xsl:copy-of select="@*"/>
@@ -818,7 +565,7 @@
818
565
  </xsl:variable>
819
566
 
820
567
  <!-- iho:p/iho:fn -->
821
- <xsl:template match="iho:fn[local-name(..) = 'p' or local-name(..) = 'title']" priority="2">
568
+ <xsl:template match="iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']]" priority="2">
822
569
  <xsl:variable name="gen_id" select="generate-id(.)"/>
823
570
  <xsl:variable name="reference" select="@reference"/>
824
571
  <xsl:variable name="number">
@@ -831,13 +578,13 @@
831
578
  <fo:inline font-size="70%" keep-with-previous.within-line="always" vertical-align="super"> <!-- -->
832
579
  <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
833
580
  <!-- <xsl:value-of select="@reference"/> -->
834
- <xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@id='_normative_references']]/iho:note)"/>
581
+ <xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@normative='true']]/iho:note)"/>
835
582
  </fo:basic-link>
836
583
  </fo:inline>
837
584
  <fo:footnote-body>
838
585
  <fo:block font-size="10pt" margin-bottom="12pt">
839
586
  <fo:inline id="footnote_{@reference}_{$number}" font-size="60%" vertical-align="super" keep-with-next.within-line="always" padding-right="1mm"> <!-- font-size="60%" alignment-baseline="hanging" -->
840
- <xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@id='_normative_references']]/iho:note)"/>
587
+ <xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@normative='true']]/iho:note)"/>
841
588
  </fo:inline>
842
589
  <xsl:for-each select="iho:p">
843
590
  <xsl:apply-templates/>
@@ -860,122 +607,34 @@
860
607
  <xsl:apply-templates/>
861
608
  </xsl:template>
862
609
 
863
-
864
- <xsl:template match="iho:figure">
865
- <fo:block-container id="{@id}">
866
- <fo:block>
867
- <xsl:apply-templates/>
868
- </fo:block>
869
- <xsl:call-template name="fn_display_figure"/>
870
- <xsl:for-each select="iho:note//iho:p">
871
- <xsl:call-template name="note"/>
872
- </xsl:for-each>
873
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-top="6pt" margin-bottom="6pt" keep-with-previous="always">
874
- <xsl:call-template name="getFigureNumber"/>
875
- <xsl:if test="iho:name">
876
- <xsl:if test="not(local-name(..) = 'figure') and not(ancestor::iho:example)">
877
- <xsl:text> — </xsl:text>
878
- </xsl:if>
879
- <xsl:apply-templates select="iho:name" mode="figure_name"/>
880
- </xsl:if>
881
- </fo:block>
882
- </fo:block-container>
883
- </xsl:template>
884
610
 
885
- <xsl:template match="iho:figure/iho:name" mode="figure_name">
886
- <xsl:apply-templates/>
611
+ <xsl:template match="iho:ul | iho:ol" mode="ul_ol">
612
+ <fo:list-block provisional-distance-between-starts="6mm">
613
+ <xsl:apply-templates/>
614
+ </fo:list-block>
615
+ <xsl:for-each select="./iho:note">
616
+ <xsl:call-template name="note"/>
617
+ </xsl:for-each>
887
618
  </xsl:template>
888
619
 
889
- <xsl:template match="iho:figure/iho:name"/>
890
- <xsl:template match="iho:figure/iho:fn" priority="2"/>
891
- <xsl:template match="iho:figure/iho:note"/>
892
-
893
- <xsl:template match="iho:image">
894
- <fo:block text-align="center">
895
- <xsl:variable name="src">
896
- <xsl:choose>
897
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
898
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
899
- </xsl:when>
900
- <xsl:otherwise>
901
- <xsl:value-of select="@src"/>
902
- </xsl:otherwise>
903
- </xsl:choose>
904
- </xsl:variable>
905
- <fo:external-graphic src="{$src}" width="100%" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/> <!-- src="{@src}" -->
620
+ <xsl:template match="iho:ul//iho:note | iho:ol//iho:note" priority="2"/>
621
+ <xsl:template match="iho:ul//iho:note | iho:ol//iho:note" mode="process">
622
+ <fo:block id="{@id}">
623
+ <xsl:apply-templates select="iho:name" mode="presentation"/>
624
+ <xsl:apply-templates mode="process"/>
906
625
  </fo:block>
907
626
  </xsl:template>
908
-
909
- <xsl:template name="getFigureNumber">
910
- <xsl:variable name="title-figure">
911
- <xsl:call-template name="getTitle">
912
- <xsl:with-param name="name" select="'title-figure'"/>
913
- </xsl:call-template>
914
- </xsl:variable>
915
- <xsl:choose>
916
- <xsl:when test="ancestor::iho:annex">
917
- <xsl:choose>
918
- <xsl:when test="local-name(..) = 'figure'">
919
- <xsl:number format="a) "/>
920
- </xsl:when>
921
- <xsl:otherwise>
922
- <xsl:value-of select="$title-figure"/>
923
-
924
- <xsl:variable name="annex_id" select="ancestor::iho:annex[1]/@id"/>
925
- <xsl:choose>
926
- <xsl:when test="ancestor::iho:annex/@obligation = 'informative'">
927
- <xsl:number format="1." count="iho:annex[@obligation = 'informative']"/>
928
- <xsl:number format="1" level="any" count="iho:figure[ancestor::iho:annex[@id = $annex_id]]"/>
929
- <!-- <xsl:number format="1.1" level="multiple" count="iho:annex[@obligation = 'informative'] | iho:figure"/> -->
930
- </xsl:when>
931
- <xsl:otherwise>
932
- <xsl:number format="A." level="any" count="iho:annex[not(@obligation = 'informative')]"/>
933
- <xsl:number format="1" level="any" count="iho:figure[ancestor::iho:annex[@id = $annex_id]]"/>
934
- <!-- <xsl:number format="A.1" level="multiple" count="iho:annex[not(@obligation = 'informative')] | iho:figure"/> -->
935
- </xsl:otherwise>
936
- </xsl:choose>
937
- </xsl:otherwise>
938
- </xsl:choose>
939
- </xsl:when>
940
- <xsl:when test="ancestor::iho:example"/>
941
- <xsl:otherwise>
942
- <xsl:value-of select="$title-figure"/><xsl:number format="1" level="any" count="iho:figure"/>
943
- </xsl:otherwise>
944
- </xsl:choose>
945
- </xsl:template>
946
-
947
- <xsl:template match="iho:note/iho:p" name="note">
948
- <fo:block font-size="11pt" margin-top="8pt" margin-bottom="12pt" text-align="justify">
949
- <xsl:if test="ancestor::iho:td">
950
- <xsl:attribute name="font-size">12pt</xsl:attribute>
951
- </xsl:if>
952
- <xsl:variable name="claims_id" select="ancestor::iho:clause[1]/@id"/>
953
- <fo:inline font-size="11pt" padding-right="2mm">
954
- <xsl:variable name="title-note">
955
- <xsl:call-template name="getTitle">
956
- <xsl:with-param name="name" select="'title-note'"/>
957
- </xsl:call-template>
958
- </xsl:variable>
959
- <xsl:value-of select="$title-note"/>
960
- <xsl:if test="count(ancestor::iho:clause[1]//iho:note) &gt; 1">
961
- <xsl:number count="iho:note[ancestor::iho:clause[@id = $claims_id]]" level="any"/>
962
- </xsl:if>
963
- </fo:inline>
627
+ <xsl:template match="iho:ul//iho:note/iho:name | iho:ol//iho:note/iho:name" mode="process" priority="2"/>
628
+ <xsl:template match="iho:ul//iho:note/iho:p | iho:ol//iho:note/iho:p" mode="process" priority="2">
629
+ <fo:block font-size="11pt" margin-top="4pt">
964
630
  <xsl:apply-templates/>
965
631
  </fo:block>
966
632
  </xsl:template>
967
-
968
-
969
- <xsl:template match="iho:ul | iho:ol">
970
- <fo:list-block provisional-distance-between-starts="6mm">
971
- <xsl:apply-templates/>
972
- </fo:list-block>
973
- <xsl:for-each select="./iho:note//iho:p">
974
- <xsl:call-template name="note"/>
975
- </xsl:for-each>
633
+
634
+ <xsl:template match="iho:ul//iho:note/* | iho:ol//iho:note/*" mode="process">
635
+ <xsl:apply-templates select="."/>
976
636
  </xsl:template>
977
637
 
978
- <xsl:template match="iho:ul//iho:note | iho:ol//iho:note"/>
979
638
 
980
639
  <xsl:template match="iho:li">
981
640
  <fo:list-item id="{@id}" margin-bottom="12pt">
@@ -985,8 +644,10 @@
985
644
  </fo:block>
986
645
  </fo:list-item-label>
987
646
  <fo:list-item-body start-indent="body-start()">
988
- <xsl:apply-templates/>
989
- <xsl:apply-templates select=".//iho:note" mode="process"/>
647
+ <fo:block>
648
+ <xsl:apply-templates/>
649
+ <xsl:apply-templates select=".//iho:note" mode="process"/>
650
+ </fo:block>
990
651
  </fo:list-item-body>
991
652
  </fo:list-item>
992
653
  </xsl:template>
@@ -1002,27 +663,7 @@
1002
663
  </xsl:choose>
1003
664
  </xsl:template>
1004
665
 
1005
- <xsl:template match="iho:termsource">
1006
- <fo:block margin-bottom="12pt">
1007
- <!-- Example:[SOURCE: [3]] -->
1008
- <fo:basic-link internal-destination="{iho:origin/@bibitemid}" fox:alt-text="{iho:origin/@citeas}">
1009
- <xsl:text>[</xsl:text>
1010
- <xsl:variable name="title-source">
1011
- <xsl:call-template name="getTitle">
1012
- <xsl:with-param name="name" select="'title-source'"/>
1013
- </xsl:call-template>
1014
- </xsl:variable>
1015
- <xsl:value-of select="$title-source"/>
1016
- <xsl:text>: </xsl:text>
1017
- <fo:inline color="blue" text-decoration="underline"><xsl:value-of select="iho:origin/@citeas"/></fo:inline>
1018
-
1019
- <xsl:apply-templates select="iho:origin/iho:localityStack"/>
1020
-
1021
- </fo:basic-link>
1022
- <xsl:apply-templates select="iho:modification"/>
1023
- <xsl:text>]</xsl:text>
1024
- </fo:block>
1025
- </xsl:template>
666
+
1026
667
 
1027
668
  <xsl:template match="iho:admonition">
1028
669
  <fo:block-container border="0.5pt solid rgb(79, 129, 189)" color="rgb(79, 129, 189)" margin-left="16mm" margin-right="16mm" margin-bottom="12pt">
@@ -1037,130 +678,28 @@
1037
678
  </fo:block-container>
1038
679
  </xsl:template>
1039
680
 
1040
- <xsl:template match="iho:formula">
1041
- <fo:block id="{@id}">
1042
- <xsl:apply-templates/>
1043
- </fo:block>
1044
- </xsl:template>
1045
-
1046
- <xsl:template match="iho:formula/iho:dt/iho:stem">
1047
- <fo:inline>
1048
- <xsl:apply-templates/>
1049
- </fo:inline>
1050
- </xsl:template>
1051
-
681
+
1052
682
  <xsl:template match="iho:formula/iho:stem">
1053
683
  <fo:block margin-top="6pt" margin-bottom="12pt" text-align="center">
1054
684
  <xsl:apply-templates/>
1055
685
  </fo:block>
1056
686
  </xsl:template>
1057
687
 
1058
- <xsl:template match="iho:quote">
1059
- <fo:block margin-left="12.5mm" margin-right="14mm">
1060
- <xsl:apply-templates select=".//iho:p"/>
1061
- </fo:block>
1062
- <xsl:if test="iho:author or iho:source">
1063
- <fo:block text-align="right">
1064
- <xsl:if test="iho:author">
1065
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
1066
- <xsl:text>— </xsl:text><xsl:value-of select="iho:author"/>
1067
- </xsl:if>
1068
- <xsl:if test="iho:source">
1069
- <xsl:text>, </xsl:text>
1070
- <xsl:apply-templates select="iho:source"/>
1071
- </xsl:if>
1072
- </fo:block>
1073
- </xsl:if>
1074
- </xsl:template>
1075
-
1076
- <xsl:template match="iho:source">
1077
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
1078
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1079
- <xsl:apply-templates select="iho:localityStack"/>
1080
- </fo:basic-link>
1081
- </xsl:template>
1082
688
 
1083
-
1084
- <xsl:template match="iho:xref">
1085
- <xsl:param name="sectionNum"/>
1086
-
1087
- <xsl:variable name="target" select="normalize-space(@target)"/>
1088
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}">
1089
- <xsl:variable name="section" select="xalan:nodeset($contents)//item[@id = $target]/@section"/>
1090
- <!-- <xsl:if test="not(starts-with($section, 'Figure') or starts-with($section, 'Table'))"> -->
1091
- <xsl:attribute name="color">blue</xsl:attribute>
1092
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1093
- <!-- </xsl:if> -->
1094
- <xsl:variable name="type" select="xalan:nodeset($contents)//item[@id = $target]/@type"/>
1095
- <xsl:variable name="root" select="xalan:nodeset($contents)//item[@id =$target]/@root"/>
1096
- <xsl:variable name="level" select="xalan:nodeset($contents)//item[@id =$target]/@level"/>
1097
- <xsl:choose>
1098
- <xsl:when test="$type = 'clause' and $root != 'annex' and $level = 1 and normalize-space(.) = ''"><!-- and not (ancestor::annex) -->
1099
- <xsl:variable name="title-clause">
1100
- <xsl:call-template name="getTitle">
1101
- <xsl:with-param name="name" select="'title-clause'"/>
1102
- </xsl:call-template>
1103
- </xsl:variable>
1104
- <xsl:value-of select="$title-clause"/>
1105
- </xsl:when>
1106
- <xsl:when test="$type = 'li'">
1107
- <xsl:attribute name="color">black</xsl:attribute>
1108
- <xsl:attribute name="text-decoration">none</xsl:attribute>
1109
- <xsl:variable name="parent_section" select="xalan:nodeset($contents)//item[@id =$target]/@parent_section"/>
1110
- <xsl:variable name="currentSection">
1111
- <xsl:call-template name="getSection"/>
1112
- </xsl:variable>
1113
- <xsl:if test="not(contains($parent_section, $currentSection))">
1114
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{$target}">
1115
- <xsl:attribute name="color">blue</xsl:attribute>
1116
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1117
- <xsl:value-of select="$parent_section"/><xsl:text> </xsl:text>
1118
- </fo:basic-link>
1119
- </xsl:if>
1120
- </xsl:when>
1121
- <xsl:otherwise/> <!-- <xsl:value-of select="$type"/> -->
1122
- </xsl:choose>
1123
- <xsl:choose>
1124
- <xsl:when test="normalize-space(.) != ''">
1125
- <xsl:apply-templates/>
1126
- </xsl:when>
1127
- <xsl:otherwise>
1128
- <xsl:value-of select="$section"/>
1129
- </xsl:otherwise>
1130
- </xsl:choose>
1131
- </fo:basic-link>
1132
- </xsl:template>
1133
-
1134
- <xsl:template match="iho:annex">
1135
- <fo:block break-after="page"/>
1136
- <xsl:if test="not(iho:title)">
1137
- <fo:block id="{@id}" font-size="13pt" font-weight="bold" text-align="center" margin-bottom="12pt" keep-with-next="always">
1138
- <xsl:choose>
1139
- <xsl:when test="@obligation = 'informative'">
1140
- <xsl:variable name="title-appendix">
1141
- <xsl:call-template name="getTitle">
1142
- <xsl:with-param name="name" select="'title-appendix'"/>
1143
- </xsl:call-template>
1144
- </xsl:variable>
1145
- <xsl:value-of select="$title-appendix"/>
1146
- <xsl:number format="1" level="any" count="iho:annex[@obligation = 'informative']"/>
1147
- </xsl:when>
1148
- <xsl:otherwise>
1149
- <xsl:variable name="title-annex">
1150
- <xsl:call-template name="getTitle">
1151
- <xsl:with-param name="name" select="'title-annex'"/>
1152
- </xsl:call-template>
1153
- </xsl:variable>
1154
- <xsl:value-of select="$title-annex"/>
1155
- <xsl:number format="A" level="any" count="iho:annex[not(@obligation = 'informative')]"/>
1156
- </xsl:otherwise>
1157
- </xsl:choose>
1158
- </fo:block>
1159
- </xsl:if>
1160
- <xsl:apply-templates/>
689
+
690
+ <xsl:template match="iho:references"><!-- [position() &gt; 1] -->
691
+ <fo:block id="{@id}">
692
+ <xsl:apply-templates/>
693
+ </fo:block>
1161
694
  </xsl:template>
1162
695
 
1163
- <!-- Example: [1] IHO S-100, Universal Hydrographic Data Model v4.0.0, December 2018 (Encoding, Feature Catalogue) -->
696
+
697
+ <!-- IHO documents:
698
+ "[1] S57 edition 3.1: IHO Transfer Standard for Digital Hydrographic Data, International Hydrographic Organization (www.iho.int)”
699
+ [{number}] {docID} edition {edition}: {title}, {author/organization}
700
+
701
+ Non-IHO documents:
702
+ Provide title and publisher -->
1164
703
  <xsl:template match="iho:bibitem">
1165
704
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm" line-height="115%">
1166
705
  <fo:list-item>
@@ -1173,39 +712,35 @@
1173
712
  </fo:list-item-label>
1174
713
  <fo:list-item-body start-indent="body-start()">
1175
714
  <fo:block>
1176
- <xsl:variable name="docidentifier">
1177
- <xsl:if test="iho:docidentifier">
1178
- <xsl:choose>
1179
- <xsl:when test="iho:docidentifier/@type = 'metanorma'"/>
1180
- <xsl:otherwise><xsl:value-of select="iho:docidentifier"/></xsl:otherwise>
1181
- </xsl:choose>
1182
- </xsl:if>
1183
- </xsl:variable>
1184
- <xsl:value-of select="$docidentifier"/>
1185
- <xsl:apply-templates select="iho:note"/>
1186
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1187
- <xsl:choose>
1188
- <xsl:when test="iho:title[@type = 'main' and @language = 'en']">
1189
- <xsl:apply-templates select="iho:title[@type = 'main' and @language = 'en']"/>
1190
- </xsl:when>
1191
- <xsl:otherwise>
1192
- <xsl:apply-templates select="iho:title"/>
1193
- </xsl:otherwise>
1194
- </xsl:choose>
1195
- <xsl:apply-templates select="iho:formattedref"/>
715
+ <xsl:call-template name="processBibitem"/>
1196
716
  </fo:block>
1197
717
  </fo:list-item-body>
1198
718
  </fo:list-item>
1199
719
  </fo:list-block>
1200
720
  </xsl:template>
1201
721
 
722
+ <xsl:template match="iho:bibitem/iho:edition">
723
+ <xsl:text> edition </xsl:text>
724
+ <xsl:value-of select="."/>
725
+ </xsl:template>
726
+
1202
727
  <xsl:template match="iho:bibitem/iho:title">
1203
728
  <fo:inline font-style="italic">
1204
729
  <xsl:apply-templates/>
1205
730
  </fo:inline>
1206
731
  </xsl:template>
1207
732
 
1208
- <xsl:template match="iho:bibitem/iho:note">
733
+ <xsl:template match="iho:bibitem/iho:uri">
734
+ <xsl:text> (</xsl:text>
735
+ <fo:inline xsl:use-attribute-sets="link-style">
736
+ <fo:basic-link external-destination="." fox:alt-text=".">
737
+ <xsl:value-of select="."/>
738
+ </fo:basic-link>
739
+ </fo:inline>
740
+ <xsl:text>)</xsl:text>
741
+ </xsl:template>
742
+
743
+ <xsl:template match="iho:bibitem/iho:note" priority="2">
1209
744
  <fo:footnote>
1210
745
  <xsl:variable name="number">
1211
746
  <xsl:number level="any" count="iho:bibitem/iho:note"/>
@@ -1226,38 +761,10 @@
1226
761
  </fo:footnote>
1227
762
  </xsl:template>
1228
763
 
1229
- <xsl:template match="iho:example">
1230
- <fo:block font-size="11pt" margin-top="8pt" margin-bottom="12pt">
1231
- <xsl:variable name="claims_id" select="ancestor::iho:clause[1]/@id"/>
1232
- <fo:block margin-bottom="12pt" font-weight="bold">
1233
- <fo:inline padding-right="5mm">
1234
- <xsl:variable name="title-example">
1235
- <xsl:call-template name="getTitle">
1236
- <xsl:with-param name="name" select="'title-example'"/>
1237
- </xsl:call-template>
1238
- </xsl:variable>
1239
- <xsl:value-of select="$title-example"/>
1240
- <xsl:choose>
1241
- <xsl:when test="iho:name">
1242
- <xsl:text>— </xsl:text><xsl:apply-templates select="iho:name" mode="example"/>
1243
- </xsl:when>
1244
- <!-- <xsl:when test="count(ancestor::iho:clause[1]//iho:example) &gt; 1">
1245
- <xsl:number count="iho:example[ancestor::iho:clause[@id = $claims_id]]" level="any"/>
1246
- </xsl:when> -->
1247
- </xsl:choose>
1248
- </fo:inline>
1249
- </fo:block>
1250
- <xsl:apply-templates/>
1251
- </fo:block>
1252
- </xsl:template>
1253
764
 
1254
- <xsl:template match="iho:example/iho:name"/>
1255
- <xsl:template match="iho:example/iho:name" mode="example">
1256
- <fo:inline><xsl:apply-templates/></fo:inline>
1257
- </xsl:template>
1258
765
 
1259
- <xsl:template match="iho:example/iho:p">
1260
- <fo:block-container font-size="11pt" margin-left="12.7mm">
766
+ <xsl:template match="iho:example/iho:p" priority="2">
767
+ <fo:block-container xsl:use-attribute-sets="example-p-style">
1261
768
  <fo:block-container margin-left="0mm">
1262
769
  <fo:block>
1263
770
  <xsl:apply-templates/>
@@ -1266,32 +773,7 @@
1266
773
  </fo:block-container>
1267
774
  </xsl:template>
1268
775
 
1269
- <!-- <eref type="inline" bibitemid="iso-19115-1" citeas="ISO 19115-1:2014/Amd 1">...<localityStack><locality type="clause"><referenceFrom>113-01-12</referenceFrom></locality></localityStack></eref> -->
1270
- <xsl:template match="iho:eref">
1271
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> <!-- font-size="9pt" color="blue" vertical-align="super" -->
1272
- <xsl:if test="@type = 'footnote'">
1273
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1274
- <xsl:attribute name="font-size">80%</xsl:attribute>
1275
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1276
- <xsl:attribute name="vertical-align">super</xsl:attribute>
1277
- </xsl:if>
1278
- <xsl:if test="@type = 'inline'">
1279
- <xsl:attribute name="color">blue</xsl:attribute>
1280
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
1281
- </xsl:if>
1282
- <xsl:choose>
1283
- <xsl:when test="@citeas and normalize-space(text()) = ''">
1284
- <xsl:value-of select="@citeas"/> <!-- disable-output-escaping="yes" -->
1285
- </xsl:when>
1286
- <xsl:when test="@bibitemid and normalize-space(text()) = ''">
1287
- <xsl:value-of select="//iho:bibitem[@id = current()/@bibitemid]/iho:docidentifier"/>
1288
- </xsl:when>
1289
- <xsl:otherwise/>
1290
- </xsl:choose>
1291
- <xsl:apply-templates select="iho:localityStack"/>
1292
- <xsl:apply-templates select="text()"/>
1293
- </fo:basic-link>
1294
- </xsl:template>
776
+
1295
777
 
1296
778
  <xsl:template match="iho:pagebreak">
1297
779
  <xsl:copy-of select="."/>
@@ -1300,30 +782,12 @@
1300
782
  <!-- https://github.com/metanorma/mn-native-pdf/issues/214 -->
1301
783
  <xsl:template match="iho:index"/>
1302
784
 
1303
- <xsl:template match="iho:review"/>
1304
-
1305
- <xsl:template match="iho:term">
1306
- <xsl:param name="sectionNum"/>
1307
- <fo:block id="{@id}" margin-bottom="10pt">
1308
- <xsl:apply-templates>
1309
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1310
- </xsl:apply-templates>
1311
- </fo:block>
1312
- </xsl:template>
1313
785
 
1314
786
  <xsl:template match="iho:preferred">
1315
- <xsl:param name="sectionNum"/>
787
+
1316
788
  <fo:block line-height="1.1">
1317
789
  <fo:block font-weight="bold" keep-with-next="always">
1318
- <fo:inline>
1319
- <xsl:variable name="section">
1320
- <xsl:call-template name="getSection">
1321
- <xsl:with-param name="sectionNum" select="$sectionNum"/>
1322
- </xsl:call-template>
1323
- </xsl:variable>
1324
- <xsl:value-of select="$section"/>
1325
- <!-- <xsl:value-of select="$sectionNum"/>.<xsl:number count="iho:term"/> -->
1326
- </fo:inline>
790
+ <xsl:apply-templates select="ancestor::iho:term/iho:name" mode="presentation"/>
1327
791
  </fo:block>
1328
792
  <fo:block font-weight="bold" keep-with-next="always">
1329
793
  <xsl:apply-templates/>
@@ -1331,122 +795,9 @@
1331
795
  </fo:block>
1332
796
  </xsl:template>
1333
797
 
1334
- <xsl:template match="iho:admitted">
1335
- <fo:block>
1336
- <xsl:apply-templates/>
1337
- </fo:block>
1338
- </xsl:template>
1339
-
1340
- <xsl:template match="iho:deprecates">
1341
- <xsl:variable name="title-deprecated">
1342
- <xsl:call-template name="getTitle">
1343
- <xsl:with-param name="name" select="'title-deprecated'"/>
1344
- </xsl:call-template>
1345
- </xsl:variable>
1346
- <fo:block><xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/></fo:block>
1347
- </xsl:template>
1348
-
1349
- <xsl:template match="iho:definition[preceding-sibling::iho:domain]">
1350
- <xsl:apply-templates/>
1351
- </xsl:template>
1352
- <xsl:template match="iho:definition[preceding-sibling::iho:domain]/iho:p">
1353
- <fo:inline> <xsl:apply-templates/></fo:inline>
1354
- <fo:block> </fo:block>
1355
- </xsl:template>
1356
-
1357
- <xsl:template match="iho:definition">
1358
- <fo:block margin-bottom="6pt">
1359
- <xsl:apply-templates/>
1360
- </fo:block>
1361
- </xsl:template>
1362
-
1363
- <xsl:template match="iho:termexample">
1364
- <fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt" text-align="justify">
1365
- <fo:inline padding-right="5mm">
1366
- <xsl:variable name="title-example">
1367
- <xsl:call-template name="getTitle">
1368
- <xsl:with-param name="name" select="'title-example'"/>
1369
- </xsl:call-template>
1370
- </xsl:variable>
1371
- <xsl:value-of select="$title-example"/>
1372
- <xsl:if test="count(ancestor::iho:term[1]//iho:termexample) &gt; 1">
1373
- <xsl:number/>
1374
- </xsl:if>
1375
- </fo:inline>
1376
- <xsl:apply-templates/>
1377
- </fo:block>
1378
- </xsl:template>
1379
-
1380
- <xsl:template match="iho:termexample/iho:p">
1381
- <fo:inline><xsl:apply-templates/></fo:inline>
1382
- </xsl:template>
1383
798
 
1384
799
 
1385
-
1386
- <xsl:template match="iho:domain">
1387
- <fo:inline>&lt;<xsl:apply-templates/>&gt;</fo:inline><xsl:text> </xsl:text>
1388
- </xsl:template>
1389
-
1390
- <xsl:template match="iho:termnote">
1391
- <fo:block font-size="10pt" margin-top="8pt" margin-bottom="8pt" text-align="justify">
1392
- <xsl:variable name="num"><xsl:number/></xsl:variable>
1393
- <xsl:variable name="title-note-to-entry">
1394
- <xsl:call-template name="getTitle">
1395
- <xsl:with-param name="name" select="'title-note-to-entry'"/>
1396
- </xsl:call-template>
1397
- </xsl:variable>
1398
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($title-note-to-entry),'#',$num)"/>
1399
- <xsl:apply-templates/>
1400
- </fo:block>
1401
- </xsl:template>
1402
-
1403
- <xsl:template match="iho:termnote/iho:p">
1404
- <fo:inline><xsl:apply-templates/></fo:inline>
1405
- <!-- <xsl:if test="following-sibling::* and not(following-sibling::iho:p)">
1406
- <xsl:value-of select="$linebreak"/>
1407
- <xsl:value-of select="$linebreak"/>
1408
- </xsl:if> -->
1409
- </xsl:template>
1410
-
1411
-
1412
- <xsl:template match="iho:modification/iho:p">
1413
- <fo:inline><xsl:apply-templates/></fo:inline>
1414
- </xsl:template>
1415
-
1416
- <xsl:template match="iho:locality">
1417
- <xsl:variable name="title-clause">
1418
- <xsl:call-template name="getTitle">
1419
- <xsl:with-param name="name" select="'title-clause'"/>
1420
- </xsl:call-template>
1421
- </xsl:variable>
1422
- <xsl:variable name="title-annex">
1423
- <xsl:call-template name="getTitle">
1424
- <xsl:with-param name="name" select="'title-annex'"/>
1425
- </xsl:call-template>
1426
- </xsl:variable>
1427
- <xsl:variable name="title-appendix">
1428
- <xsl:call-template name="getTitle">
1429
- <xsl:with-param name="name" select="'title-appendix'"/>
1430
- </xsl:call-template>
1431
- </xsl:variable>
1432
- <xsl:variable name="title-table">
1433
- <xsl:call-template name="getTitle">
1434
- <xsl:with-param name="name" select="'title-table'"/>
1435
- </xsl:call-template>
1436
- </xsl:variable>
1437
- <xsl:choose>
1438
- <xsl:when test="ancestor::iho:termsource"/>
1439
- <xsl:when test="@type ='clause' and ancestor::iho:eref"/>
1440
- <xsl:when test="@type ='clause'"><xsl:value-of select="$title-clause"/></xsl:when>
1441
- <xsl:when test="@type ='annex'"><xsl:value-of select="$title-annex"/></xsl:when>
1442
- <xsl:when test="@type ='appendix'"><xsl:value-of select="$title-appendix"/></xsl:when>
1443
- <xsl:when test="@type ='table'"><xsl:value-of select="$title-table"/></xsl:when>
1444
- <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
1445
- </xsl:choose>
1446
- <xsl:text> </xsl:text><xsl:value-of select="iho:referenceFrom"/>
1447
- </xsl:template>
1448
800
 
1449
-
1450
801
  <xsl:template name="insertHeaderFooter">
1451
802
  <xsl:param name="font-weight" select="'bold'"/>
1452
803
  <fo:static-content flow-name="header-odd">
@@ -1491,127 +842,6 @@
1491
842
  </fo:static-content>
1492
843
  </xsl:template>
1493
844
 
1494
-
1495
- <xsl:template name="getSection">
1496
- <xsl:param name="sectionNum"/>
1497
- <xsl:variable name="level">
1498
- <xsl:call-template name="getLevel"/>
1499
- </xsl:variable>
1500
- <xsl:variable name="section">
1501
- <xsl:choose>
1502
- <xsl:when test="ancestor::iho:bibliography">
1503
- <xsl:value-of select="$sectionNum"/>
1504
- </xsl:when>
1505
- <xsl:when test="ancestor::iho:sections">
1506
- <!-- 1, 2, 3, 4, ... from main section (not annex, bibliography, ...) -->
1507
- <xsl:choose>
1508
- <xsl:when test="$level = 1">
1509
- <xsl:value-of select="$sectionNum"/><xsl:text>.</xsl:text>
1510
- </xsl:when>
1511
- <xsl:when test="$level &gt;= 2">
1512
- <xsl:variable name="num">
1513
- <xsl:call-template name="getSubSection"/>
1514
- </xsl:variable>
1515
- <xsl:value-of select="concat($sectionNum, $num)"/><xsl:text>.</xsl:text>
1516
- </xsl:when>
1517
- <xsl:otherwise>
1518
- <!-- z<xsl:value-of select="$sectionNum"/>z -->
1519
- </xsl:otherwise>
1520
- </xsl:choose>
1521
- </xsl:when>
1522
- <!-- <xsl:when test="ancestor::iho:annex[@obligation = 'informative']">
1523
- <xsl:choose>
1524
- <xsl:when test="$level = 1">
1525
- <xsl:text>Annex </xsl:text>
1526
- <xsl:number format="I" level="any" count="iho:annex[@obligation = 'informative']"/>
1527
- </xsl:when>
1528
- <xsl:otherwise>
1529
- <xsl:number format="I.1" level="multiple" count="iho:annex[@obligation = 'informative'] | iho:clause"/>
1530
- </xsl:otherwise>
1531
- </xsl:choose>
1532
- </xsl:when> -->
1533
- <xsl:when test="ancestor::iho:annex">
1534
- <xsl:variable name="annexid" select="normalize-space(/iho:iho-standard/iho:bibdata/iho:ext/iho:structuredidentifier/iho:annexid)"/>
1535
- <xsl:choose>
1536
- <xsl:when test="$level = 1">
1537
- <xsl:choose>
1538
- <xsl:when test="ancestor::iho:annex/@obligation = 'informative'">
1539
- <xsl:variable name="title-appendix">
1540
- <xsl:call-template name="getTitle">
1541
- <xsl:with-param name="name" select="'title-appendix'"/>
1542
- </xsl:call-template>
1543
- </xsl:variable>
1544
- <xsl:value-of select="$title-appendix"/>
1545
- </xsl:when>
1546
- <xsl:otherwise>
1547
- <xsl:variable name="title-annex">
1548
- <xsl:call-template name="getTitle">
1549
- <xsl:with-param name="name" select="'title-annex'"/>
1550
- </xsl:call-template>
1551
- </xsl:variable>
1552
- <xsl:value-of select="$title-annex"/>
1553
- </xsl:otherwise>
1554
- </xsl:choose>
1555
-
1556
- <xsl:choose>
1557
- <xsl:when test="count(//iho:annex) = 1 and $annexid != ''">
1558
- <xsl:value-of select="$annexid"/>
1559
- </xsl:when>
1560
- <xsl:otherwise>
1561
- <xsl:choose>
1562
- <xsl:when test="ancestor::iho:annex/@obligation = 'informative'">
1563
- <xsl:number format="1" level="any" count="iho:annex[@obligation = 'informative']"/>
1564
- </xsl:when>
1565
- <xsl:otherwise>
1566
- <xsl:number format="A" level="any" count="iho:annex[not(@obligation = 'informative')]"/>
1567
- <!-- <xsl:number format="A" level="any" count="iho:annex"/> -->
1568
- </xsl:otherwise>
1569
- </xsl:choose>
1570
- </xsl:otherwise>
1571
- </xsl:choose>
1572
- </xsl:when>
1573
- <xsl:otherwise>
1574
- <xsl:choose>
1575
- <xsl:when test="count(//iho:annex) = 1 and $annexid != ''">
1576
- <xsl:value-of select="$annexid"/><xsl:number format=".1" level="multiple" count="iho:clause"/>
1577
- </xsl:when>
1578
- <xsl:otherwise>
1579
-
1580
- <xsl:choose>
1581
- <xsl:when test="ancestor::iho:annex/@obligation = 'informative'">
1582
- <xsl:number format="1.1." level="multiple" count="iho:annex[@obligation = 'informative'] | iho:clause"/>
1583
- </xsl:when>
1584
- <xsl:otherwise>
1585
- <xsl:number format="A.1." level="multiple" count="iho:annex[not(@obligation = 'informative')] | iho:clause"/>
1586
- <!-- <xsl:number format="A.1." level="multiple" count="iho:annex | iho:clause"/> -->
1587
- </xsl:otherwise>
1588
- </xsl:choose>
1589
-
1590
-
1591
- </xsl:otherwise>
1592
- </xsl:choose>
1593
- </xsl:otherwise>
1594
- </xsl:choose>
1595
- </xsl:when>
1596
- <!-- if preface and there is clause(s) -->
1597
- <!-- <xsl:when test="ancestor::iho:preface">
1598
- <xsl:choose>
1599
- <xsl:when test="$level = 1 and ..//iho:clause">0</xsl:when>
1600
- <xsl:when test="$level &gt;= 2">
1601
- <xsl:variable name="num">
1602
- <xsl:number format=".1" level="multiple" count="iho:clause"/>
1603
- </xsl:variable>
1604
- <xsl:value-of select="concat('0', $num)"/>
1605
- </xsl:when>
1606
- <xsl:otherwise></xsl:otherwise>
1607
- </xsl:choose>
1608
- </xsl:when> -->
1609
- <xsl:otherwise>
1610
- </xsl:otherwise>
1611
- </xsl:choose>
1612
- </xsl:variable>
1613
- <xsl:value-of select="$section"/>
1614
- </xsl:template>
1615
845
 
1616
846
  <xsl:template name="getListItemFormat">
1617
847
  <xsl:choose>
@@ -1709,46 +939,6 @@
1709
939
  </xsl:variable>
1710
940
 
1711
941
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
1712
-
1713
- <title-table lang="en">Table </title-table>
1714
- <title-table lang="fr">Tableau </title-table>
1715
-
1716
- <title-table lang="zh">Table </title-table>
1717
-
1718
-
1719
-
1720
- <title-note lang="en">NOTE </title-note>
1721
- <title-note lang="fr">NOTE </title-note>
1722
-
1723
- <title-note lang="zh">NOTE </title-note>
1724
-
1725
-
1726
-
1727
- <title-figure lang="en">Figure </title-figure>
1728
- <title-figure lang="fr">Figure </title-figure>
1729
-
1730
- <title-figure lang="zh">Figure </title-figure>
1731
-
1732
-
1733
-
1734
- <title-example lang="en">EXAMPLE </title-example>
1735
- <title-example lang="fr">EXEMPLE </title-example>
1736
-
1737
- <title-example lang="zh">EXAMPLE </title-example>
1738
-
1739
-
1740
-
1741
- <title-example-xref lang="en">Example </title-example-xref>
1742
- <title-example-xref lang="fr">Exemple </title-example-xref>
1743
-
1744
- <title-section lang="en">Section </title-section>
1745
- <title-section lang="fr">Section </title-section>
1746
-
1747
- <title-inequality lang="en">Inequality </title-inequality>
1748
- <title-inequality lang="fr">Inequality </title-inequality>
1749
-
1750
- <title-equation lang="en">Equation </title-equation>
1751
- <title-equation lang="fr">Equation </title-equation>
1752
942
 
1753
943
  <title-annex lang="en">Annex </title-annex>
1754
944
  <title-annex lang="fr">Annexe </title-annex>
@@ -1756,17 +946,7 @@
1756
946
  <title-annex lang="zh">Annex </title-annex>
1757
947
 
1758
948
 
1759
-
1760
- <title-appendix lang="en">Appendix </title-appendix>
1761
- <title-appendix lang="fr">Appendix </title-appendix>
1762
-
1763
- <title-clause lang="en">Clause </title-clause>
1764
- <title-clause lang="fr">Article </title-clause>
1765
-
1766
- <title-clause lang="zh">Clause </title-clause>
1767
-
1768
-
1769
-
949
+
1770
950
  <title-edition lang="en">
1771
951
 
1772
952
  <xsl:text>Edition </xsl:text>
@@ -1774,9 +954,7 @@
1774
954
 
1775
955
  </title-edition>
1776
956
 
1777
- <title-formula lang="en">Formula </title-formula>
1778
- <title-formula lang="fr">Formula </title-formula>
1779
-
957
+
1780
958
  <title-toc lang="en">
1781
959
 
1782
960
  <xsl:text>Contents</xsl:text>
@@ -1811,13 +989,6 @@
1811
989
  </title-part>
1812
990
  <title-part lang="zh">第 # 部分:</title-part>
1813
991
 
1814
- <title-note-to-entry lang="en">Note # to entry: </title-note-to-entry>
1815
- <title-note-to-entry lang="fr">Note # à l'article: </title-note-to-entry>
1816
-
1817
- <title-note-to-entry lang="zh">Note # to entry: </title-note-to-entry>
1818
-
1819
-
1820
-
1821
992
  <title-modified lang="en">modified</title-modified>
1822
993
  <title-modified lang="fr">modifiée</title-modified>
1823
994
 
@@ -1825,20 +996,23 @@
1825
996
 
1826
997
 
1827
998
 
1828
- <title-source lang="en">SOURCE</title-source>
999
+ <title-source lang="en">
1000
+
1001
+ <xsl:text>SOURCE</xsl:text>
1002
+
1003
+
1004
+ </title-source>
1829
1005
 
1830
1006
  <title-keywords lang="en">Keywords</title-keywords>
1831
1007
 
1832
1008
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1833
1009
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1834
-
1835
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1836
-
1010
+
1837
1011
  <title-list-tables lang="en">List of Tables</title-list-tables>
1838
1012
 
1839
1013
  <title-list-figures lang="en">List of Figures</title-list-figures>
1840
1014
 
1841
- <title-recommendation lang="en">Recommendation </title-recommendation>
1015
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1842
1016
 
1843
1017
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1844
1018
 
@@ -1848,8 +1022,6 @@
1848
1022
 
1849
1023
  <title-in lang="en">in </title-in>
1850
1024
 
1851
- <title-box lang="en">Box </title-box>
1852
-
1853
1025
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1854
1026
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1855
1027
 
@@ -1872,7 +1044,11 @@
1872
1044
  <title-warning lang="zh">警告</title-warning>
1873
1045
 
1874
1046
  <title-amendment lang="en">AMENDMENT</title-amendment>
1875
- </xsl:variable><xsl:template name="getTitle">
1047
+
1048
+ <title-continued lang="en">(continued)</title-continued>
1049
+ <title-continued lang="fr">(continué)</title-continued>
1050
+
1051
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1876
1052
  <xsl:param name="name"/>
1877
1053
  <xsl:variable name="lang">
1878
1054
  <xsl:call-template name="getLang"/>
@@ -1892,7 +1068,10 @@
1892
1068
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1893
1069
 
1894
1070
 
1071
+
1895
1072
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1073
+ <xsl:attribute name="white-space">pre</xsl:attribute>
1074
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1896
1075
 
1897
1076
 
1898
1077
 
@@ -1901,163 +1080,463 @@
1901
1080
 
1902
1081
 
1903
1082
 
1904
- <xsl:attribute name="font-family">SFMono-Regular</xsl:attribute>
1905
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1083
+
1084
+ <xsl:attribute name="font-family">SFMono-Regular</xsl:attribute>
1906
1085
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1907
1086
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1908
1087
  <xsl:attribute name="line-height">113%</xsl:attribute>
1909
1088
 
1910
- </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1089
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1911
1090
 
1091
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1912
1092
 
1093
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1913
1094
 
1914
- </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1095
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
1915
1096
 
1097
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
1916
1098
 
1099
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1917
1100
 
1918
- </xsl:attribute-set><xsl:template match="text()">
1919
- <xsl:value-of select="."/>
1920
- </xsl:template><xsl:template match="*[local-name()='br']">
1921
- <xsl:value-of select="$linebreak"/>
1922
- </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1923
- <!-- <xsl:call-template name="add-zero-spaces"/> -->
1924
- <xsl:call-template name="add-zero-spaces-java"/>
1925
- </xsl:template><xsl:template match="*[local-name()='table']">
1926
-
1927
- <xsl:variable name="simple-table">
1928
- <!-- <xsl:copy> -->
1929
- <xsl:call-template name="getSimpleTable"/>
1930
- <!-- </xsl:copy> -->
1931
- </xsl:variable>
1932
-
1933
- <!-- DEBUG -->
1934
- <!-- SourceTable=<xsl:copy-of select="current()"/>EndSourceTable -->
1935
- <!-- Simpletable=<xsl:copy-of select="$simple-table"/>EndSimpltable -->
1936
-
1937
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
1101
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1102
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1103
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1938
1104
 
1939
- <!-- <xsl:if test="$namespace = 'iso'">
1940
- <fo:block space-before="6pt">&#xA0;</fo:block>
1941
- </xsl:if> -->
1942
1105
 
1943
- <xsl:choose>
1944
- <xsl:when test="@unnumbered = 'true'"/>
1945
- <xsl:otherwise>
1946
-
1947
-
1948
-
1949
- <fo:block font-weight="bold" text-align="center" margin-bottom="6pt" keep-with-next="always">
1950
-
1951
-
1952
-
1953
-
1954
-
1955
-
1956
-
1957
-
1958
- <xsl:attribute name="font-weight">normal</xsl:attribute>
1959
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1960
-
1961
- <xsl:variable name="title-table">
1962
- <xsl:call-template name="getTitle">
1963
- <xsl:with-param name="name" select="'title-table'"/>
1964
- </xsl:call-template>
1965
- </xsl:variable>
1966
- <xsl:value-of select="$title-table"/>
1967
-
1968
- <xsl:call-template name="getTableNumber"/>
1969
-
1970
-
1971
- <xsl:if test="*[local-name()='name']">
1972
-
1973
-
1974
-
1975
- <xsl:text> — </xsl:text>
1976
-
1977
- <xsl:apply-templates select="*[local-name()='name']" mode="process"/>
1978
- </xsl:if>
1979
- </fo:block>
1980
-
1981
-
1982
- <xsl:call-template name="fn_name_display"/>
1983
-
1984
- </xsl:otherwise>
1985
- </xsl:choose>
1106
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1107
+
1108
+
1109
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1110
+
1111
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1112
+
1113
+
1114
+
1115
+
1116
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1117
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1118
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1119
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1120
+
1121
+
1122
+
1123
+
1124
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
1125
+
1126
+
1127
+
1128
+
1129
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1130
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1131
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1141
+
1142
+
1143
+
1144
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1145
+
1146
+
1147
+
1148
+
1149
+
1150
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1151
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1152
+
1986
1153
 
1987
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1988
1154
 
1989
- <!-- <xsl:variable name="cols-count">
1990
- <xsl:choose>
1991
- <xsl:when test="*[local-name()='thead']">
1992
- <xsl:call-template name="calculate-columns-numbers">
1993
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1994
- </xsl:call-template>
1995
- </xsl:when>
1996
- <xsl:otherwise>
1997
- <xsl:call-template name="calculate-columns-numbers">
1998
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1999
- </xsl:call-template>
2000
- </xsl:otherwise>
2001
- </xsl:choose>
2002
- </xsl:variable> -->
2003
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2004
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2005
1155
 
2006
1156
 
2007
1157
 
2008
- <xsl:variable name="colwidths">
2009
- <xsl:call-template name="calculate-column-widths">
2010
- <xsl:with-param name="cols-count" select="$cols-count"/>
2011
- <xsl:with-param name="table" select="$simple-table"/>
2012
- </xsl:call-template>
2013
- </xsl:variable>
2014
1158
 
2015
- <!-- <xsl:variable name="colwidths2">
2016
- <xsl:call-template name="calculate-column-widths">
2017
- <xsl:with-param name="cols-count" select="$cols-count"/>
2018
- </xsl:call-template>
2019
- </xsl:variable> -->
2020
1159
 
2021
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2022
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2023
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2024
1160
 
2025
- <xsl:variable name="margin-left">
2026
- <xsl:choose>
2027
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2028
- <xsl:otherwise>0</xsl:otherwise>
2029
- </xsl:choose>
2030
- </xsl:variable>
2031
1161
 
2032
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2033
-
2034
-
2035
-
2036
-
2037
-
2038
-
2039
-
2040
-
2041
- <xsl:attribute name="space-after">18pt</xsl:attribute>
2042
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2043
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2044
-
2045
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2046
-
2047
-
2048
1162
 
1163
+
1164
+
1165
+
1166
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1167
+
1168
+
1169
+
1170
+
1171
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1172
+ <xsl:attribute name="margin-left">12.7mm</xsl:attribute>
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1184
+
1185
+
1186
+
1187
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1188
+
2049
1189
 
1190
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1191
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1192
+
1193
+
1194
+
1195
+
1196
+ <xsl:attribute name="text-align">center</xsl:attribute>
1197
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1198
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1199
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1200
+
2050
1201
 
1202
+
1203
+
1204
+
2051
1205
 
1206
+
1207
+
1208
+ </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1209
+
1210
+
1211
+
1212
+ </xsl:attribute-set><xsl:attribute-set name="appendix-example-style">
1213
+
1214
+
1215
+
1216
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1217
+
1218
+
1219
+ <xsl:attribute name="color">blue</xsl:attribute>
1220
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1221
+
1222
+
1223
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1224
+
1225
+
1226
+
1227
+
1228
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1229
+
1230
+
1231
+
2052
1232
 
1233
+
1234
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1235
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1236
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1237
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+
1245
+
1246
+
1247
+ </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1248
+
1249
+
1250
+
1251
+
1252
+
1253
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1254
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+
1262
+
1263
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1264
+
1265
+
1266
+
2053
1267
 
1268
+
1269
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1270
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1281
+
1282
+
1283
+
1284
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1285
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1286
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1287
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1288
+
1289
+
1290
+
1291
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2054
1292
 
1293
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1294
+
1295
+
1296
+
1297
+
1298
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1299
+ <xsl:attribute name="margin-right">14mm</xsl:attribute>
1300
+
1301
+
1302
+
1303
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1304
+
1305
+
1306
+ <xsl:attribute name="text-align">right</xsl:attribute>
2055
1307
 
2056
-
2057
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2058
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2059
1308
 
2060
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1309
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1310
+
1311
+
1312
+
1313
+
1314
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1315
+
1316
+
1317
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1318
+
1319
+
1320
+ <xsl:attribute name="color">blue</xsl:attribute>
1321
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1322
+
1323
+
1324
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1325
+
1326
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
1327
+
1328
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1337
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1338
+ <xsl:attribute name="text-align">center</xsl:attribute>
1339
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1340
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1341
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1342
+
1343
+
1344
+
1345
+
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+
1353
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1354
+
1355
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1356
+ <xsl:attribute name="text-align">center</xsl:attribute>
1357
+
1358
+
1359
+
1360
+
1361
+
1362
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1363
+
1364
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1365
+
1366
+ <xsl:attribute name="width">100%</xsl:attribute>
1367
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1368
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1375
+
1376
+
1377
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1378
+
1379
+
1380
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1381
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1382
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1383
+ <xsl:attribute name="text-align">center</xsl:attribute>
1384
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1385
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1386
+
1387
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1388
+
1389
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1390
+
1391
+
1392
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1393
+
1394
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1395
+
1396
+
1397
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1398
+
1399
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1400
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1401
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1402
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1403
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1404
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1405
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1406
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1407
+
1408
+ <!-- Normative references -->
1409
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1410
+ <!-- Terms and definitions -->
1411
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1412
+ <!-- Another main sections -->
1413
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1414
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1415
+ <!-- Bibliography -->
1416
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1417
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1418
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1419
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1420
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1421
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1422
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1423
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1424
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1425
+
1426
+ <!-- Normative references -->
1427
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1428
+ <!-- Terms and definitions -->
1429
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1430
+ <!-- Another main sections -->
1431
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1432
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1433
+ <!-- Bibliography -->
1434
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1435
+ </xsl:template><xsl:template match="text()">
1436
+ <xsl:value-of select="."/>
1437
+ </xsl:template><xsl:template match="*[local-name()='br']">
1438
+ <xsl:value-of select="$linebreak"/>
1439
+ </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
1440
+ <!-- <xsl:call-template name="add-zero-spaces"/> -->
1441
+ <xsl:call-template name="add-zero-spaces-java"/>
1442
+ </xsl:template><xsl:template match="*[local-name()='table']">
1443
+
1444
+ <xsl:variable name="simple-table">
1445
+ <xsl:call-template name="getSimpleTable"/>
1446
+ </xsl:variable>
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+ <!-- $namespace = 'iso' or -->
1453
+
1454
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1455
+
1456
+
1457
+
1458
+ <xsl:call-template name="fn_name_display"/>
1459
+
1460
+
1461
+
1462
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1463
+
1464
+ <!-- <xsl:variable name="cols-count">
1465
+ <xsl:choose>
1466
+ <xsl:when test="*[local-name()='thead']">
1467
+ <xsl:call-template name="calculate-columns-numbers">
1468
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1469
+ </xsl:call-template>
1470
+ </xsl:when>
1471
+ <xsl:otherwise>
1472
+ <xsl:call-template name="calculate-columns-numbers">
1473
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1474
+ </xsl:call-template>
1475
+ </xsl:otherwise>
1476
+ </xsl:choose>
1477
+ </xsl:variable> -->
1478
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1479
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1480
+
1481
+
1482
+
1483
+ <xsl:variable name="colwidths">
1484
+ <xsl:call-template name="calculate-column-widths">
1485
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1486
+ <xsl:with-param name="table" select="$simple-table"/>
1487
+ </xsl:call-template>
1488
+ </xsl:variable>
1489
+
1490
+ <!-- <xsl:variable name="colwidths2">
1491
+ <xsl:call-template name="calculate-column-widths">
1492
+ <xsl:with-param name="cols-count" select="$cols-count"/>
1493
+ </xsl:call-template>
1494
+ </xsl:variable> -->
1495
+
1496
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1497
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
1498
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1499
+
1500
+ <xsl:variable name="margin-left">
1501
+ <xsl:choose>
1502
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1503
+ <xsl:otherwise>0</xsl:otherwise>
1504
+ </xsl:choose>
1505
+ </xsl:variable>
1506
+
1507
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1508
+
1509
+
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+ <xsl:attribute name="space-after">18pt</xsl:attribute>
1517
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1518
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1519
+
1520
+
1521
+ <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1522
+
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+
1532
+
1533
+
1534
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1535
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1536
+
1537
+
1538
+
1539
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2061
1540
  <xsl:choose>
2062
1541
  <xsl:when test=". = 1 or . = 0">
2063
1542
  <fo:table-column column-width="proportional-column-width(2)"/>
@@ -2081,32 +1560,16 @@
2081
1560
 
2082
1561
 
2083
1562
 
1563
+
1564
+
2084
1565
  </fo:block-container>
2085
- </xsl:template><xsl:template name="getTableNumber">
2086
- <xsl:choose>
2087
- <xsl:when test="ancestor::*[local-name()='executivesummary']"> <!-- NIST -->
2088
- <xsl:text>ES-</xsl:text><xsl:number format="1" count="*[local-name()='executivesummary']//*[local-name()='table'][not(@unnumbered) or @unnumbered != 'true']"/>
2089
- </xsl:when>
2090
- <xsl:when test="ancestor::*[local-name()='annex']">
2091
-
2092
-
2093
-
2094
-
2095
-
2096
-
1566
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1567
+ <xsl:if test="normalize-space() != ''">
1568
+ <fo:block xsl:use-attribute-sets="table-name-style">
2097
1569
 
2098
-
2099
- </xsl:when>
2100
- <xsl:otherwise>
2101
-
2102
-
2103
- <xsl:number format="A." count="*[local-name()='annex']"/>
2104
- <xsl:number format="1" level="any" count="//*[local-name()='table'] [not(ancestor::*[local-name()='annex']) and not(ancestor::*[local-name()='executivesummary']) and not(ancestor::*[local-name()='bibdata'])] [not(@unnumbered) or @unnumbered != 'true']"/>
2105
-
2106
- </xsl:otherwise>
2107
- </xsl:choose>
2108
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']"/><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="process">
2109
- <xsl:apply-templates/>
1570
+ <xsl:apply-templates/>
1571
+ </fo:block>
1572
+ </xsl:if>
2110
1573
  </xsl:template><xsl:template name="calculate-columns-numbers">
2111
1574
  <xsl:param name="table-row"/>
2112
1575
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2221,10 +1684,25 @@
2221
1684
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2222
1685
  <xsl:param name="cols-count"/>
2223
1686
  <!-- font-weight="bold" -->
2224
- <fo:table-header>
2225
-
1687
+ <fo:table-header>
1688
+
2226
1689
  <xsl:apply-templates/>
2227
1690
  </fo:table-header>
1691
+ </xsl:template><xsl:template name="table-header-title">
1692
+ <xsl:param name="cols-count"/>
1693
+ <!-- row for title -->
1694
+ <fo:table-row>
1695
+ <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
1696
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1697
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1698
+ <xsl:call-template name="fn_name_display"/>
1699
+ </xsl:for-each>
1700
+ <fo:block text-align="right" font-style="italic">
1701
+ <xsl:text> </xsl:text>
1702
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1703
+ </fo:block>
1704
+ </fo:table-cell>
1705
+ </fo:table-row>
2228
1706
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
2229
1707
  <fo:table-body>
2230
1708
  <xsl:apply-templates/>
@@ -2288,6 +1766,8 @@
2288
1766
  </xsl:choose>
2289
1767
  </xsl:variable>
2290
1768
 
1769
+
1770
+
2291
1771
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
2292
1772
  <xsl:with-param name="cols-count" select="$cols-count"/>
2293
1773
  </xsl:apply-templates>
@@ -2297,6 +1777,8 @@
2297
1777
  </xsl:call-template>
2298
1778
 
2299
1779
  <fo:table-body>
1780
+
1781
+
2300
1782
  <xsl:apply-templates/>
2301
1783
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
2302
1784
 
@@ -2319,11 +1801,24 @@
2319
1801
 
2320
1802
  </xsl:if>
2321
1803
 
1804
+
1805
+
2322
1806
 
2323
1807
  <xsl:apply-templates/>
2324
1808
  </fo:table-row>
2325
1809
  </xsl:template><xsl:template match="*[local-name()='th']">
2326
1810
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1811
+ <xsl:attribute name="text-align">
1812
+ <xsl:choose>
1813
+ <xsl:when test="@align">
1814
+ <xsl:value-of select="@align"/>
1815
+ </xsl:when>
1816
+ <xsl:otherwise>center</xsl:otherwise>
1817
+ </xsl:choose>
1818
+ </xsl:attribute>
1819
+
1820
+
1821
+
2327
1822
 
2328
1823
 
2329
1824
 
@@ -2341,17 +1836,38 @@
2341
1836
  <xsl:value-of select="@rowspan"/>
2342
1837
  </xsl:attribute>
2343
1838
  </xsl:if>
1839
+ <xsl:call-template name="display-align"/>
2344
1840
  <fo:block>
2345
1841
  <xsl:apply-templates/>
2346
1842
  </fo:block>
2347
1843
  </fo:table-cell>
1844
+ </xsl:template><xsl:template name="display-align">
1845
+ <xsl:if test="@valign">
1846
+ <xsl:attribute name="display-align">
1847
+ <xsl:choose>
1848
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1849
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1850
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1851
+ <xsl:otherwise>before</xsl:otherwise>
1852
+ </xsl:choose>
1853
+ </xsl:attribute>
1854
+ </xsl:if>
2348
1855
  </xsl:template><xsl:template match="*[local-name()='td']">
2349
1856
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1857
+ <xsl:attribute name="text-align">
1858
+ <xsl:choose>
1859
+ <xsl:when test="@align">
1860
+ <xsl:value-of select="@align"/>
1861
+ </xsl:when>
1862
+ <xsl:otherwise>left</xsl:otherwise>
1863
+ </xsl:choose>
1864
+ </xsl:attribute>
2350
1865
  <!-- and ancestor::*[local-name() = 'thead'] -->
2351
1866
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2352
1867
 
2353
1868
 
2354
1869
 
1870
+
2355
1871
 
2356
1872
 
2357
1873
 
@@ -2368,24 +1884,12 @@
2368
1884
  <xsl:value-of select="@rowspan"/>
2369
1885
  </xsl:attribute>
2370
1886
  </xsl:if>
2371
- <fo:block>
2372
-
1887
+ <xsl:call-template name="display-align"/>
1888
+ <fo:block>
2373
1889
  <xsl:apply-templates/>
2374
- </fo:block>
2375
- <!-- <xsl:choose>
2376
- <xsl:when test="count(*) = 1 and *[local-name() = 'p']">
2377
- <xsl:apply-templates />
2378
- </xsl:when>
2379
- <xsl:otherwise>
2380
- <fo:block>
2381
- <xsl:apply-templates />
2382
- </fo:block>
2383
- </xsl:otherwise>
2384
- </xsl:choose> -->
2385
-
2386
-
1890
+ </fo:block>
2387
1891
  </fo:table-cell>
2388
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
1892
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2389
1893
 
2390
1894
 
2391
1895
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2398,29 +1902,18 @@
2398
1902
  <fo:inline padding-right="2mm">
2399
1903
 
2400
1904
 
2401
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1905
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1906
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
2402
1907
 
2403
1908
 
2404
- <xsl:variable name="title-note">
2405
- <xsl:call-template name="getTitle">
2406
- <xsl:with-param name="name" select="'title-note'"/>
2407
- </xsl:call-template>
2408
- </xsl:variable>
2409
- <xsl:value-of select="$title-note"/>
2410
-
2411
- <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
2412
- <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1">
2413
- <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/>
2414
- </xsl:if>
1909
+
1910
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2415
1911
 
2416
-
2417
-
2418
-
2419
1912
  </fo:inline>
2420
1913
  <xsl:apply-templates mode="process"/>
2421
1914
  </fo:block>
2422
1915
 
2423
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
1916
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2424
1917
  <xsl:apply-templates/>
2425
1918
  </xsl:template><xsl:template name="fn_display">
2426
1919
  <xsl:variable name="references">
@@ -2480,7 +1973,7 @@
2480
1973
  <!-- and (not(@class) or @class !='pseudocode') -->
2481
1974
  </xsl:variable>
2482
1975
  <xsl:variable name="references">
2483
- <xsl:for-each select=".//*[local-name()='fn']">
1976
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2484
1977
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2485
1978
  <xsl:apply-templates/>
2486
1979
  </fn>
@@ -2574,6 +2067,7 @@
2574
2067
 
2575
2068
 
2576
2069
 
2070
+
2577
2071
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2578
2072
 
2579
2073
  <xsl:value-of select="@reference"/>
@@ -2584,119 +2078,133 @@
2584
2078
  <xsl:apply-templates/>
2585
2079
  </fo:inline>
2586
2080
  </xsl:template><xsl:template match="*[local-name()='dl']">
2587
- <xsl:variable name="parent" select="local-name(..)"/>
2588
-
2589
- <xsl:variable name="key_iso">
2590
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2591
- </xsl:variable>
2592
-
2593
- <xsl:choose>
2594
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2081
+ <fo:block-container margin-left="0mm">
2082
+ <xsl:if test="parent::*[local-name() = 'note']">
2083
+ <xsl:attribute name="margin-left">
2084
+ <xsl:choose>
2085
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2086
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2087
+ </xsl:choose>
2088
+ </xsl:attribute>
2595
2089
 
2090
+ </xsl:if>
2091
+ <fo:block-container margin-left="0mm">
2092
+
2093
+ <xsl:variable name="parent" select="local-name(..)"/>
2596
2094
 
2597
- <fo:block margin-bottom="12pt" text-align="left">
2598
-
2599
- <xsl:variable name="title-where">
2600
- <xsl:call-template name="getTitle">
2601
- <xsl:with-param name="name" select="'title-where'"/>
2602
- </xsl:call-template>
2603
- </xsl:variable>
2604
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2605
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2606
- <xsl:text/>
2607
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2608
- </fo:block>
2095
+ <xsl:variable name="key_iso">
2096
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2097
+ </xsl:variable>
2609
2098
 
2610
- </xsl:when>
2611
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2612
- <fo:block margin-bottom="12pt" text-align="left">
2613
-
2614
-
2615
-
2616
-
2617
- <xsl:variable name="title-where">
2618
- <xsl:call-template name="getTitle">
2619
- <xsl:with-param name="name" select="'title-where'"/>
2620
- </xsl:call-template>
2621
- </xsl:variable>
2622
- <xsl:value-of select="$title-where"/>
2623
- </fo:block>
2624
- </xsl:when>
2625
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2626
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2627
-
2628
-
2629
-
2630
- <xsl:variable name="title-key">
2631
- <xsl:call-template name="getTitle">
2632
- <xsl:with-param name="name" select="'title-key'"/>
2633
- </xsl:call-template>
2634
- </xsl:variable>
2635
- <xsl:value-of select="$title-key"/>
2636
- </fo:block>
2637
- </xsl:when>
2638
- </xsl:choose>
2639
-
2640
- <!-- a few components -->
2641
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2642
- <fo:block>
2643
-
2644
-
2645
-
2646
-
2647
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
2099
+ <xsl:choose>
2100
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2101
+
2102
+
2103
+ <fo:block margin-bottom="12pt" text-align="left">
2104
+
2105
+ <xsl:variable name="title-where">
2106
+ <xsl:call-template name="getTitle">
2107
+ <xsl:with-param name="name" select="'title-where'"/>
2108
+ </xsl:call-template>
2109
+ </xsl:variable>
2110
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2111
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2112
+ <xsl:text/>
2113
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2114
+ </fo:block>
2115
+
2116
+ </xsl:when>
2117
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2118
+ <fo:block margin-bottom="12pt" text-align="left">
2119
+
2120
+
2121
+
2122
+
2123
+ <xsl:variable name="title-where">
2124
+ <xsl:call-template name="getTitle">
2125
+ <xsl:with-param name="name" select="'title-where'"/>
2126
+ </xsl:call-template>
2127
+ </xsl:variable>
2128
+ <xsl:value-of select="$title-where"/>
2129
+ </fo:block>
2130
+ </xsl:when>
2131
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2132
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2133
+
2134
+
2135
+
2136
+ <xsl:variable name="title-key">
2137
+ <xsl:call-template name="getTitle">
2138
+ <xsl:with-param name="name" select="'title-key'"/>
2139
+ </xsl:call-template>
2140
+ </xsl:variable>
2141
+ <xsl:value-of select="$title-key"/>
2142
+ </fo:block>
2143
+ </xsl:when>
2144
+ </xsl:choose>
2648
2145
 
2649
- <fo:block>
2650
-
2651
-
2652
-
2653
- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
2654
-
2655
-
2656
- <fo:table width="95%" table-layout="fixed">
2146
+ <!-- a few components -->
2147
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2148
+ <fo:block>
2657
2149
 
2658
- <xsl:choose>
2659
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2660
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2661
- </xsl:when>
2662
- <xsl:when test="normalize-space($key_iso) = 'true'">
2663
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2150
+
2151
+
2152
+
2153
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
2154
+
2155
+ <fo:block>
2156
+
2157
+
2158
+
2159
+ <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
2160
+
2161
+
2162
+ <fo:table width="95%" table-layout="fixed">
2664
2163
 
2665
- </xsl:when>
2666
- </xsl:choose>
2667
- <!-- create virtual html table for dl/[dt and dd] -->
2668
- <xsl:variable name="html-table">
2669
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2670
- <xsl:element name="{$ns}:table">
2671
- <tbody>
2672
- <xsl:apply-templates mode="dl"/>
2673
- </tbody>
2674
- </xsl:element>
2675
- </xsl:variable>
2676
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2677
- <xsl:variable name="colwidths">
2678
- <xsl:call-template name="calculate-column-widths">
2679
- <xsl:with-param name="cols-count" select="2"/>
2680
- <xsl:with-param name="table" select="$html-table"/>
2681
- </xsl:call-template>
2682
- </xsl:variable>
2683
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2684
- <xsl:variable name="maxlength_dt">
2685
- <xsl:call-template name="getMaxLength_dt"/>
2686
- </xsl:variable>
2687
- <xsl:call-template name="setColumnWidth_dl">
2688
- <xsl:with-param name="colwidths" select="$colwidths"/>
2689
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2690
- </xsl:call-template>
2691
- <fo:table-body>
2692
- <xsl:apply-templates>
2693
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2694
- </xsl:apply-templates>
2695
- </fo:table-body>
2696
- </fo:table>
2697
- </fo:block>
2698
- </fo:block>
2699
- </xsl:if>
2164
+ <xsl:choose>
2165
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2166
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2167
+ </xsl:when>
2168
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2169
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2170
+
2171
+ </xsl:when>
2172
+ </xsl:choose>
2173
+ <!-- create virtual html table for dl/[dt and dd] -->
2174
+ <xsl:variable name="html-table">
2175
+ <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2176
+ <xsl:element name="{$ns}:table">
2177
+ <tbody>
2178
+ <xsl:apply-templates mode="dl"/>
2179
+ </tbody>
2180
+ </xsl:element>
2181
+ </xsl:variable>
2182
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2183
+ <xsl:variable name="colwidths">
2184
+ <xsl:call-template name="calculate-column-widths">
2185
+ <xsl:with-param name="cols-count" select="2"/>
2186
+ <xsl:with-param name="table" select="$html-table"/>
2187
+ </xsl:call-template>
2188
+ </xsl:variable>
2189
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2190
+ <xsl:variable name="maxlength_dt">
2191
+ <xsl:call-template name="getMaxLength_dt"/>
2192
+ </xsl:variable>
2193
+ <xsl:call-template name="setColumnWidth_dl">
2194
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2195
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2196
+ </xsl:call-template>
2197
+ <fo:table-body>
2198
+ <xsl:apply-templates>
2199
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2200
+ </xsl:apply-templates>
2201
+ </fo:table-body>
2202
+ </fo:table>
2203
+ </fo:block>
2204
+ </fo:block>
2205
+ </xsl:if>
2206
+ </fo:block-container>
2207
+ </fo:block-container>
2700
2208
  </xsl:template><xsl:template name="setColumnWidth_dl">
2701
2209
  <xsl:param name="colwidths"/>
2702
2210
  <xsl:param name="maxlength_dt"/>
@@ -2751,7 +2259,7 @@
2751
2259
  <xsl:value-of select="string-length(normalize-space(.))"/>
2752
2260
  </xsl:if>
2753
2261
  </xsl:for-each>
2754
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2262
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2755
2263
  <xsl:param name="key_iso"/>
2756
2264
 
2757
2265
  <!-- <tr>
@@ -2767,12 +2275,7 @@
2767
2275
  <xsl:if test="normalize-space($key_iso) = 'true'">
2768
2276
  <xsl:attribute name="margin-top">0</xsl:attribute>
2769
2277
  </xsl:if>
2770
- <xsl:variable name="title-note">
2771
- <xsl:call-template name="getTitle">
2772
- <xsl:with-param name="name" select="'title-note'"/>
2773
- </xsl:call-template>
2774
- </xsl:variable>
2775
- <xsl:value-of select="$title-note"/>
2278
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2776
2279
  </fo:block>
2777
2280
  </fo:table-cell>
2778
2281
  <fo:table-cell>
@@ -2798,6 +2301,7 @@
2798
2301
  <xsl:param name="key_iso"/>
2799
2302
 
2800
2303
  <fo:table-row>
2304
+
2801
2305
  <fo:table-cell>
2802
2306
 
2803
2307
  <fo:block margin-top="6pt">
@@ -2826,14 +2330,36 @@
2826
2330
  <fo:table-cell>
2827
2331
  <fo:block>
2828
2332
 
2829
-
2333
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2334
+ <xsl:if test="local-name(*[1]) != 'stem'">
2335
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2336
+ </xsl:if>
2337
+ </xsl:if> -->
2830
2338
 
2831
2339
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2832
2340
 
2833
2341
  </fo:block>
2834
2342
  </fo:table-cell>
2835
2343
  </fo:table-row>
2836
-
2344
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2345
+ <xsl:if test="local-name(*[1]) = 'stem'">
2346
+ <fo:table-row>
2347
+ <fo:table-cell>
2348
+ <fo:block margin-top="6pt">
2349
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2350
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2351
+ </xsl:if>
2352
+ <xsl:text>&#xA0;</xsl:text>
2353
+ </fo:block>
2354
+ </fo:table-cell>
2355
+ <fo:table-cell>
2356
+ <fo:block>
2357
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2358
+ </fo:block>
2359
+ </fo:table-cell>
2360
+ </fo:table-row>
2361
+ </xsl:if>
2362
+ </xsl:if> -->
2837
2363
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2838
2364
  <xsl:apply-templates/>
2839
2365
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2844,7 +2370,7 @@
2844
2370
  <fo:inline font-style="italic">
2845
2371
  <xsl:apply-templates/>
2846
2372
  </fo:inline>
2847
- </xsl:template><xsl:template match="*[local-name()='strong']">
2373
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2848
2374
  <fo:inline font-weight="bold">
2849
2375
  <xsl:apply-templates/>
2850
2376
  </fo:inline>
@@ -2857,7 +2383,32 @@
2857
2383
  <xsl:apply-templates/>
2858
2384
  </fo:inline>
2859
2385
  </xsl:template><xsl:template match="*[local-name()='tt']">
2860
- <fo:inline font-family="Courier" font-size="10pt">
2386
+ <fo:inline xsl:use-attribute-sets="tt-style">
2387
+ <xsl:variable name="_font-size">
2388
+
2389
+
2390
+
2391
+
2392
+ 10
2393
+
2394
+
2395
+
2396
+
2397
+
2398
+
2399
+
2400
+
2401
+
2402
+ </xsl:variable>
2403
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2404
+ <xsl:if test="$font-size != ''">
2405
+ <xsl:attribute name="font-size">
2406
+ <xsl:choose>
2407
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2408
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2409
+ </xsl:choose>
2410
+ </xsl:attribute>
2411
+ </xsl:if>
2861
2412
  <xsl:apply-templates/>
2862
2413
  </fo:inline>
2863
2414
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3143,162 +2694,1192 @@
3143
2694
  <xsl:copy-of select="xalan:nodeset($normalizedTDs)"/>
3144
2695
  </xsl:copy>
3145
2696
  </xsl:variable>
3146
- <xsl:copy-of select="$newRow"/>
3147
-
3148
- <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3149
- <xsl:with-param name="previousRow" select="$newRow"/>
3150
- </xsl:apply-templates>
3151
- </xsl:template><xsl:template name="getLang">
2697
+ <xsl:copy-of select="$newRow"/>
2698
+
2699
+ <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
2700
+ <xsl:with-param name="previousRow" select="$newRow"/>
2701
+ </xsl:apply-templates>
2702
+ </xsl:template><xsl:template name="getLang">
2703
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2704
+ <xsl:choose>
2705
+ <xsl:when test="$language = 'English'">en</xsl:when>
2706
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
2707
+ </xsl:choose>
2708
+ </xsl:template><xsl:template name="capitalizeWords">
2709
+ <xsl:param name="str"/>
2710
+ <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
2711
+ <xsl:choose>
2712
+ <xsl:when test="contains($str2, ' ')">
2713
+ <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
2714
+ <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
2715
+ <xsl:value-of select="substring($substr, 2)"/> -->
2716
+ <xsl:call-template name="capitalize">
2717
+ <xsl:with-param name="str" select="$substr"/>
2718
+ </xsl:call-template>
2719
+ <xsl:text> </xsl:text>
2720
+ <xsl:call-template name="capitalizeWords">
2721
+ <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
2722
+ </xsl:call-template>
2723
+ </xsl:when>
2724
+ <xsl:otherwise>
2725
+ <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
2726
+ <xsl:value-of select="substring($str2, 2)"/> -->
2727
+ <xsl:call-template name="capitalize">
2728
+ <xsl:with-param name="str" select="$str2"/>
2729
+ </xsl:call-template>
2730
+ </xsl:otherwise>
2731
+ </xsl:choose>
2732
+ </xsl:template><xsl:template name="capitalize">
2733
+ <xsl:param name="str"/>
2734
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2735
+ <xsl:value-of select="substring($str, 2)"/>
2736
+ </xsl:template><xsl:template match="mathml:math">
2737
+ <fo:inline font-family="STIX2Math">
2738
+ <xsl:variable name="mathml">
2739
+ <xsl:apply-templates select="." mode="mathml"/>
2740
+ </xsl:variable>
2741
+ <fo:instream-foreign-object fox:alt-text="Math">
2742
+ <!-- <xsl:copy-of select="."/> -->
2743
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2744
+ </fo:instream-foreign-object>
2745
+ </fo:inline>
2746
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2747
+ <xsl:copy>
2748
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2749
+ </xsl:copy>
2750
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2751
+ <xsl:copy>
2752
+ <!-- replace start and end spaces to non-break space -->
2753
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2754
+ </xsl:copy>
2755
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2756
+ <xsl:variable name="target">
2757
+ <xsl:choose>
2758
+ <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
2759
+ <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
2760
+ </xsl:when>
2761
+ <xsl:otherwise>
2762
+ <xsl:value-of select="normalize-space(@target)"/>
2763
+ </xsl:otherwise>
2764
+ </xsl:choose>
2765
+ </xsl:variable>
2766
+ <fo:inline xsl:use-attribute-sets="link-style">
2767
+ <xsl:choose>
2768
+ <xsl:when test="$target = ''">
2769
+ <xsl:apply-templates/>
2770
+ </xsl:when>
2771
+ <xsl:otherwise>
2772
+ <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
2773
+ <xsl:choose>
2774
+ <xsl:when test="normalize-space(.) = ''">
2775
+ <xsl:value-of select="$target"/>
2776
+ </xsl:when>
2777
+ <xsl:otherwise>
2778
+ <xsl:apply-templates/>
2779
+ </xsl:otherwise>
2780
+ </xsl:choose>
2781
+ </fo:basic-link>
2782
+ </xsl:otherwise>
2783
+ </xsl:choose>
2784
+ </fo:inline>
2785
+ </xsl:template><xsl:template match="*[local-name()='bookmark']">
2786
+ <fo:inline id="{@id}"/>
2787
+ </xsl:template><xsl:template match="*[local-name()='appendix']">
2788
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
2789
+ <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
2790
+ </fo:block>
2791
+ <xsl:apply-templates/>
2792
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
2793
+ <fo:inline><xsl:apply-templates/></fo:inline>
2794
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2795
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2796
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2797
+ </fo:block>
2798
+ <xsl:apply-templates/>
2799
+ </xsl:template><xsl:template match="*[local-name() = 'callout']">
2800
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
2801
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']">
2802
+ <xsl:variable name="annotation-id" select="@id"/>
2803
+ <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
2804
+ <fo:block id="{$annotation-id}" white-space="nowrap">
2805
+ <fo:inline>
2806
+ <xsl:apply-templates>
2807
+ <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
2808
+ </xsl:apply-templates>
2809
+ </fo:inline>
2810
+ </fo:block>
2811
+ </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
2812
+ <xsl:param name="callout"/>
2813
+ <fo:inline id="{@id}">
2814
+ <!-- for first p in annotation, put <x> -->
2815
+ <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
2816
+ <xsl:apply-templates/>
2817
+ </fo:inline>
2818
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
2819
+ <xsl:variable name="title-modified">
2820
+ <xsl:call-template name="getTitle">
2821
+ <xsl:with-param name="name" select="'title-modified'"/>
2822
+ </xsl:call-template>
2823
+ </xsl:variable>
2824
+ <xsl:choose>
2825
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2826
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
2827
+ </xsl:choose>
2828
+ <xsl:apply-templates/>
2829
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2830
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2831
+
2832
+ <xsl:apply-templates/>
2833
+ </fo:basic-link>
2834
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2835
+ <fo:block-container margin-left="0mm">
2836
+ <xsl:if test="parent::*[local-name() = 'note']">
2837
+ <xsl:attribute name="margin-left">
2838
+ <xsl:choose>
2839
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2840
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2841
+ </xsl:choose>
2842
+ </xsl:attribute>
2843
+
2844
+ </xsl:if>
2845
+ <fo:block-container margin-left="0mm">
2846
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2847
+ <xsl:apply-templates/>
2848
+ </fo:block>
2849
+ </fo:block-container>
2850
+ </fo:block-container>
2851
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2852
+ <fo:inline>
2853
+ <xsl:apply-templates/>
2854
+ </fo:inline>
2855
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2856
+ <fo:inline>
2857
+ <xsl:apply-templates/>
2858
+ </fo:inline>
2859
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2860
+ <xsl:if test="normalize-space() != ''">
2861
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2862
+ </xsl:if>
2863
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2864
+
2865
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2866
+
2867
+
2868
+
2869
+
2870
+ <fo:block-container margin-left="0mm">
2871
+
2872
+
2873
+
2874
+
2875
+
2876
+
2877
+ <xsl:if test="ancestor::iho:td">
2878
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
2879
+ </xsl:if>
2880
+
2881
+
2882
+
2883
+ <fo:block>
2884
+
2885
+
2886
+
2887
+
2888
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2889
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2890
+ </fo:inline>
2891
+ <xsl:apply-templates/>
2892
+ </fo:block>
2893
+
2894
+
2895
+ </fo:block-container>
2896
+ </fo:block-container>
2897
+
2898
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2899
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2900
+ <xsl:choose>
2901
+ <xsl:when test="$num = 1">
2902
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2903
+ <xsl:apply-templates/>
2904
+ </fo:inline>
2905
+ </xsl:when>
2906
+ <xsl:otherwise>
2907
+ <fo:block xsl:use-attribute-sets="note-p-style">
2908
+ <xsl:apply-templates/>
2909
+ </fo:block>
2910
+ </xsl:otherwise>
2911
+ </xsl:choose>
2912
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2913
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2914
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
2915
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2916
+ </fo:inline>
2917
+ <xsl:apply-templates/>
2918
+ </fo:block>
2919
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
2920
+ <xsl:param name="sfx"/>
2921
+ <xsl:variable name="suffix">
2922
+ <xsl:choose>
2923
+ <xsl:when test="$sfx != ''">
2924
+ <xsl:value-of select="$sfx"/>
2925
+ </xsl:when>
2926
+ <xsl:otherwise>
2927
+
2928
+
2929
+ </xsl:otherwise>
2930
+ </xsl:choose>
2931
+ </xsl:variable>
2932
+ <xsl:if test="normalize-space() != ''">
2933
+ <xsl:apply-templates/>
2934
+ <xsl:value-of select="$suffix"/>
2935
+ </xsl:if>
2936
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2937
+ <xsl:param name="sfx"/>
2938
+ <xsl:variable name="suffix">
2939
+ <xsl:choose>
2940
+ <xsl:when test="$sfx != ''">
2941
+ <xsl:value-of select="$sfx"/>
2942
+ </xsl:when>
2943
+ <xsl:otherwise>
2944
+
2945
+
2946
+ </xsl:otherwise>
2947
+ </xsl:choose>
2948
+ </xsl:variable>
2949
+ <xsl:if test="normalize-space() != ''">
2950
+ <xsl:apply-templates/>
2951
+ <xsl:value-of select="$suffix"/>
2952
+ </xsl:if>
2953
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
2954
+ <fo:inline><xsl:apply-templates/></fo:inline>
2955
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
2956
+ <fo:block id="{@id}">
2957
+ <xsl:apply-templates/>
2958
+ </fo:block>
2959
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
2960
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
2961
+
2962
+
2963
+
2964
+ <xsl:apply-templates/>
2965
+ </fo:block>
2966
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
2967
+ <xsl:if test="normalize-space() != ''">
2968
+ <fo:inline>
2969
+ <xsl:apply-templates/>
2970
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
2971
+ <xsl:text>.</xsl:text>
2972
+ </xsl:if> -->
2973
+ </fo:inline>
2974
+ </xsl:if>
2975
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
2976
+ <fo:block-container id="{@id}">
2977
+ <fo:block>
2978
+ <xsl:apply-templates/>
2979
+ </fo:block>
2980
+ <xsl:call-template name="fn_display_figure"/>
2981
+ <xsl:for-each select="*[local-name() = 'note']">
2982
+ <xsl:call-template name="note"/>
2983
+ </xsl:for-each>
2984
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2985
+ </fo:block-container>
2986
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
2987
+ <fo:block id="{@id}">
2988
+ <xsl:apply-templates/>
2989
+ </fo:block>
2990
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
2991
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
2992
+ <xsl:apply-templates/>
2993
+ </fo:block>
2994
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
2995
+ <fo:block xsl:use-attribute-sets="image-style">
2996
+
2997
+
2998
+ <xsl:variable name="src">
2999
+ <xsl:choose>
3000
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
3001
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
3002
+ </xsl:when>
3003
+ <xsl:otherwise>
3004
+ <xsl:value-of select="@src"/>
3005
+ </xsl:otherwise>
3006
+ </xsl:choose>
3007
+ </xsl:variable>
3008
+
3009
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3010
+ </fo:block>
3011
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
3012
+ <xsl:apply-templates mode="contents"/>
3013
+ <xsl:text> </xsl:text>
3014
+ </xsl:template><xsl:template match="text()" mode="contents">
3015
+ <xsl:value-of select="."/>
3016
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3017
+ <xsl:if test="normalize-space() != ''">
3018
+ <fo:block xsl:use-attribute-sets="figure-name-style">
3019
+
3020
+ <xsl:apply-templates/>
3021
+ </fo:block>
3022
+ </xsl:if>
3023
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/><xsl:template match="*[local-name() = 'title']" mode="contents_item">
3024
+ <xsl:apply-templates mode="contents_item"/>
3025
+ <!-- <xsl:text> </xsl:text> -->
3026
+ </xsl:template><xsl:template name="getSection">
3027
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
3028
+ </xsl:template><xsl:template name="getName">
3029
+ <xsl:choose>
3030
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
3031
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3032
+ </xsl:when>
3033
+ <xsl:otherwise>
3034
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3035
+ </xsl:otherwise>
3036
+ </xsl:choose>
3037
+ </xsl:template><xsl:template name="insertTitleAsListItem">
3038
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
3039
+ <xsl:variable name="section">
3040
+ <xsl:for-each select="..">
3041
+ <xsl:call-template name="getSection"/>
3042
+ </xsl:for-each>
3043
+ </xsl:variable>
3044
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
3045
+ <fo:list-item>
3046
+ <fo:list-item-label end-indent="label-end()">
3047
+ <fo:block>
3048
+ <xsl:value-of select="$section"/>
3049
+ </fo:block>
3050
+ </fo:list-item-label>
3051
+ <fo:list-item-body start-indent="body-start()">
3052
+ <fo:block>
3053
+ <xsl:choose>
3054
+ <xsl:when test="*[local-name() = 'tab']">
3055
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3056
+ </xsl:when>
3057
+ <xsl:otherwise>
3058
+ <xsl:apply-templates/>
3059
+ </xsl:otherwise>
3060
+ </xsl:choose>
3061
+ </fo:block>
3062
+ </fo:list-item-body>
3063
+ </fo:list-item>
3064
+ </fo:list-block>
3065
+ </xsl:template><xsl:template name="extractTitle">
3066
+ <xsl:choose>
3067
+ <xsl:when test="*[local-name() = 'tab']">
3068
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
3069
+ </xsl:when>
3070
+ <xsl:otherwise>
3071
+ <xsl:apply-templates/>
3072
+ </xsl:otherwise>
3073
+ </xsl:choose>
3074
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3075
+ <xsl:text> </xsl:text>
3076
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3077
+ <xsl:copy>
3078
+ <xsl:apply-templates mode="contents_item"/>
3079
+ </xsl:copy>
3080
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3081
+ <xsl:text> </xsl:text>
3082
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3083
+
3084
+ <fo:block-container margin-left="0mm">
3085
+ <xsl:if test="parent::*[local-name() = 'note']">
3086
+ <xsl:attribute name="margin-left">
3087
+ <xsl:choose>
3088
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3089
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3090
+ </xsl:choose>
3091
+ </xsl:attribute>
3092
+
3093
+ </xsl:if>
3094
+ <fo:block-container margin-left="0mm">
3095
+
3096
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3097
+ <xsl:variable name="_font-size">
3098
+
3099
+
3100
+
3101
+
3102
+ 10
3103
+
3104
+
3105
+
3106
+
3107
+
3108
+
3109
+
3110
+
3111
+
3112
+ </xsl:variable>
3113
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3114
+ <xsl:if test="$font-size != ''">
3115
+ <xsl:attribute name="font-size">
3116
+ <xsl:choose>
3117
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3118
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3119
+ </xsl:choose>
3120
+ </xsl:attribute>
3121
+ </xsl:if>
3122
+ <xsl:apply-templates/>
3123
+ </fo:block>
3124
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3125
+
3126
+ </fo:block-container>
3127
+ </fo:block-container>
3128
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3129
+ <xsl:variable name="text">
3130
+ <xsl:call-template name="add-zero-spaces-equal"/>
3131
+ </xsl:variable>
3132
+ <xsl:call-template name="add-zero-spaces-java">
3133
+ <xsl:with-param name="text" select="$text"/>
3134
+ </xsl:call-template>
3135
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3136
+ <xsl:if test="normalize-space() != ''">
3137
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3138
+ <xsl:apply-templates/>
3139
+ </fo:block>
3140
+ </xsl:if>
3141
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
3142
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
3143
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3144
+ <xsl:apply-templates/>
3145
+ </fo:block>
3146
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
3147
+ <xsl:if test="normalize-space() != ''">
3148
+ <fo:block xsl:use-attribute-sets="permission-name-style">
3149
+ <xsl:apply-templates/>
3150
+
3151
+ </fo:block>
3152
+ </xsl:if>
3153
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
3154
+ <fo:block xsl:use-attribute-sets="permission-label-style">
3155
+ <xsl:apply-templates/>
3156
+ </fo:block>
3157
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
3158
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
3159
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3160
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
3161
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
3162
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
3163
+ <xsl:apply-templates/>
3164
+ </fo:block>
3165
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
3166
+ <xsl:if test="normalize-space() != ''">
3167
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
3168
+
3169
+ <xsl:apply-templates/>
3170
+
3171
+ </fo:block>
3172
+ </xsl:if>
3173
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3174
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3175
+ <xsl:apply-templates/>
3176
+ </fo:block>
3177
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3178
+ <fo:block>
3179
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3180
+ </fo:block>
3181
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3182
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3183
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3184
+ </fo:block>
3185
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3186
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3187
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3188
+ </fo:block>
3189
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3190
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3191
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3192
+ <xsl:apply-templates/>
3193
+ </fo:block>
3194
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3195
+ <xsl:if test="normalize-space() != ''">
3196
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3197
+ <xsl:apply-templates/>
3198
+
3199
+ </fo:block>
3200
+ </xsl:if>
3201
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3202
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3203
+ <xsl:apply-templates/>
3204
+ </fo:block>
3205
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3206
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3207
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3208
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3209
+ </xsl:if>
3210
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3211
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3212
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3213
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3214
+ </xsl:if>
3215
+ <xsl:variable name="simple-table">
3216
+ <xsl:call-template name="getSimpleTable"/>
3217
+ </xsl:variable>
3218
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3219
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3220
+ <!-- <fo:table-column column-width="35mm"/>
3221
+ <fo:table-column column-width="115mm"/> -->
3222
+ <fo:table-column column-width="30%"/>
3223
+ <fo:table-column column-width="70%"/>
3224
+ </xsl:if>
3225
+ <xsl:apply-templates mode="requirement"/>
3226
+ </fo:table>
3227
+ <!-- fn processing -->
3228
+ <xsl:if test=".//*[local-name() = 'fn']">
3229
+ <xsl:for-each select="*[local-name() = 'tbody']">
3230
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3231
+ <xsl:call-template name="fn_display"/>
3232
+ </fo:block>
3233
+ </xsl:for-each>
3234
+ </xsl:if>
3235
+ </fo:block-container>
3236
+ </fo:block-container>
3237
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3238
+ <fo:table-header>
3239
+ <xsl:apply-templates mode="requirement"/>
3240
+ </fo:table-header>
3241
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3242
+ <fo:table-body>
3243
+ <xsl:apply-templates mode="requirement"/>
3244
+ </fo:table-body>
3245
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3246
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3247
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3248
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3249
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3250
+ </xsl:if>
3251
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3252
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3253
+ </xsl:if>
3254
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3255
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3256
+ </xsl:if>
3257
+ <xsl:apply-templates mode="requirement"/>
3258
+ </fo:table-row>
3259
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3260
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3261
+ <xsl:attribute name="text-align">
3262
+ <xsl:choose>
3263
+ <xsl:when test="@align">
3264
+ <xsl:value-of select="@align"/>
3265
+ </xsl:when>
3266
+ <xsl:otherwise>left</xsl:otherwise>
3267
+ </xsl:choose>
3268
+ </xsl:attribute>
3269
+ <xsl:if test="@colspan">
3270
+ <xsl:attribute name="number-columns-spanned">
3271
+ <xsl:value-of select="@colspan"/>
3272
+ </xsl:attribute>
3273
+ </xsl:if>
3274
+ <xsl:if test="@rowspan">
3275
+ <xsl:attribute name="number-rows-spanned">
3276
+ <xsl:value-of select="@rowspan"/>
3277
+ </xsl:attribute>
3278
+ </xsl:if>
3279
+ <xsl:call-template name="display-align"/>
3280
+
3281
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3282
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3283
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3284
+ </xsl:if>
3285
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3286
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3287
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3288
+ </xsl:if> -->
3289
+
3290
+ <fo:block>
3291
+ <xsl:apply-templates/>
3292
+ </fo:block>
3293
+ </fo:table-cell>
3294
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3295
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3296
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3297
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3298
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3299
+ </xsl:if>
3300
+ <xsl:attribute name="text-align">
3301
+ <xsl:choose>
3302
+ <xsl:when test="@align">
3303
+ <xsl:value-of select="@align"/>
3304
+ </xsl:when>
3305
+ <xsl:otherwise>left</xsl:otherwise>
3306
+ </xsl:choose>
3307
+ </xsl:attribute>
3308
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3309
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3310
+ </xsl:if>
3311
+ <xsl:if test="@colspan">
3312
+ <xsl:attribute name="number-columns-spanned">
3313
+ <xsl:value-of select="@colspan"/>
3314
+ </xsl:attribute>
3315
+ </xsl:if>
3316
+ <xsl:if test="@rowspan">
3317
+ <xsl:attribute name="number-rows-spanned">
3318
+ <xsl:value-of select="@rowspan"/>
3319
+ </xsl:attribute>
3320
+ </xsl:if>
3321
+ <xsl:call-template name="display-align"/>
3322
+
3323
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3324
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3325
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3326
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3327
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3328
+ </xsl:if>
3329
+ </xsl:if> -->
3330
+ <!-- 2nd line and below -->
3331
+
3332
+ <fo:block>
3333
+ <xsl:apply-templates/>
3334
+ </fo:block>
3335
+ </fo:table-cell>
3336
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3337
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3338
+ <xsl:apply-templates/>
3339
+ </fo:block>
3340
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3341
+ <fo:block> <!-- margin-bottom="10pt" -->
3342
+ <xsl:apply-templates/>
3343
+ </fo:block>
3344
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3345
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3346
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3347
+ <xsl:apply-templates/>
3348
+ </fo:block>
3349
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3350
+ <xsl:if test="normalize-space() != ''">
3351
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3352
+ <xsl:apply-templates/>
3353
+ </fo:inline>
3354
+ </xsl:if>
3355
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3356
+ <fo:inline><xsl:apply-templates/></fo:inline>
3357
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3358
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3359
+
3360
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3361
+
3362
+ <xsl:variable name="element">
3363
+ block
3364
+
3365
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3366
+ </xsl:variable>
3367
+
3368
+ <xsl:choose>
3369
+ <xsl:when test="contains(normalize-space($element), 'block')">
3370
+ <fo:block xsl:use-attribute-sets="example-body-style">
3371
+ <xsl:apply-templates/>
3372
+ </fo:block>
3373
+ </xsl:when>
3374
+ <xsl:otherwise>
3375
+ <fo:inline>
3376
+ <xsl:apply-templates/>
3377
+ </fo:inline>
3378
+ </xsl:otherwise>
3379
+ </xsl:choose>
3380
+
3381
+ </fo:block>
3382
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3383
+
3384
+ <xsl:variable name="element">
3385
+ block
3386
+
3387
+ </xsl:variable>
3388
+ <xsl:choose>
3389
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3390
+ <fo:inline>
3391
+ <xsl:apply-templates/>
3392
+ </fo:inline>
3393
+ </xsl:when>
3394
+ <xsl:when test="normalize-space($element) = 'block'">
3395
+ <fo:block xsl:use-attribute-sets="example-name-style">
3396
+ <xsl:apply-templates/>
3397
+ </fo:block>
3398
+ </xsl:when>
3399
+ <xsl:otherwise>
3400
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3401
+ <xsl:apply-templates/>
3402
+ </fo:inline>
3403
+ </xsl:otherwise>
3404
+ </xsl:choose>
3405
+
3406
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3407
+
3408
+ <xsl:variable name="element">
3409
+ block
3410
+
3411
+ </xsl:variable>
3412
+ <xsl:choose>
3413
+ <xsl:when test="normalize-space($element) = 'block'">
3414
+ <fo:block xsl:use-attribute-sets="example-p-style">
3415
+
3416
+ <xsl:apply-templates/>
3417
+ </fo:block>
3418
+ </xsl:when>
3419
+ <xsl:otherwise>
3420
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3421
+ <xsl:apply-templates/>
3422
+ </fo:inline>
3423
+ </xsl:otherwise>
3424
+ </xsl:choose>
3425
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3426
+ <fo:block xsl:use-attribute-sets="termsource-style">
3427
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3428
+ <xsl:variable name="termsource_text">
3429
+ <xsl:apply-templates/>
3430
+ </xsl:variable>
3431
+
3432
+ <xsl:choose>
3433
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3434
+ <xsl:apply-templates/>
3435
+ </xsl:when>
3436
+ <xsl:otherwise>
3437
+
3438
+ <xsl:text>[</xsl:text>
3439
+
3440
+ <xsl:apply-templates/>
3441
+
3442
+ <xsl:text>]</xsl:text>
3443
+
3444
+ </xsl:otherwise>
3445
+ </xsl:choose>
3446
+ </fo:block>
3447
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3448
+ <xsl:if test="normalize-space() != ''">
3449
+ <xsl:value-of select="."/>
3450
+ </xsl:if>
3451
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3452
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3453
+
3454
+ <fo:inline>
3455
+
3456
+ <xsl:call-template name="getTitle">
3457
+ <xsl:with-param name="name" select="'title-source'"/>
3458
+ </xsl:call-template>
3459
+ <xsl:text>: </xsl:text>
3460
+ </fo:inline>
3461
+
3462
+ <fo:inline xsl:use-attribute-sets="origin-style">
3463
+ <xsl:apply-templates/>
3464
+ </fo:inline>
3465
+ </fo:basic-link>
3466
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3467
+ <fo:inline><xsl:apply-templates/></fo:inline>
3468
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3469
+ <xsl:if test="normalize-space() != ''">
3470
+ <xsl:value-of select="."/>
3471
+ </xsl:if>
3472
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3473
+ <fo:block-container margin-left="0mm">
3474
+ <xsl:if test="parent::*[local-name() = 'note']">
3475
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3476
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3477
+ </xsl:if>
3478
+ </xsl:if>
3479
+
3480
+ <fo:block-container margin-left="0mm">
3481
+
3482
+ <fo:block xsl:use-attribute-sets="quote-style">
3483
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3484
+ </fo:block>
3485
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3486
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3487
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3488
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3489
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3490
+ </fo:block>
3491
+ </xsl:if>
3492
+
3493
+ </fo:block-container>
3494
+ </fo:block-container>
3495
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3496
+ <xsl:if test="../*[local-name() = 'author']">
3497
+ <xsl:text>, </xsl:text>
3498
+ </xsl:if>
3499
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3500
+ <xsl:apply-templates/>
3501
+ </fo:basic-link>
3502
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3503
+ <xsl:text>— </xsl:text>
3504
+ <xsl:apply-templates/>
3505
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3506
+ <fo:inline xsl:use-attribute-sets="eref-style">
3507
+ <xsl:if test="@type = 'footnote'">
3508
+
3509
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3510
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3511
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3512
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3513
+
3514
+
3515
+ </xsl:if>
3516
+
3517
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3518
+
3519
+ <xsl:if test="@type = 'inline'">
3520
+
3521
+ <xsl:attribute name="color">blue</xsl:attribute>
3522
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3523
+
3524
+
3525
+
3526
+ </xsl:if>
3527
+
3528
+
3529
+ <xsl:apply-templates/>
3530
+ </fo:basic-link>
3531
+ </fo:inline>
3532
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3533
+ <!-- zero-space char -->
3534
+ <xsl:variable name="depth">
3535
+ <xsl:call-template name="getLevel">
3536
+ <xsl:with-param name="depth" select="../@depth"/>
3537
+ </xsl:call-template>
3538
+ </xsl:variable>
3539
+
3540
+ <xsl:variable name="padding">
3541
+
3542
+
3543
+
3544
+
3545
+
3546
+ <xsl:choose>
3547
+ <xsl:when test="$depth = 2">3</xsl:when>
3548
+ <xsl:when test="$depth = 3">3</xsl:when>
3549
+ <xsl:otherwise>4</xsl:otherwise>
3550
+ </xsl:choose>
3551
+
3552
+
3553
+
3554
+
3555
+
3556
+
3557
+
3558
+
3559
+
3560
+
3561
+
3562
+
3563
+
3564
+
3565
+ </xsl:variable>
3566
+
3567
+ <xsl:variable name="padding-right">
3568
+ <xsl:choose>
3569
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3570
+ <xsl:otherwise>
3571
+ <xsl:value-of select="normalize-space($padding)"/>
3572
+ </xsl:otherwise>
3573
+ </xsl:choose>
3574
+ </xsl:variable>
3575
+
3152
3576
  <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3577
+
3153
3578
  <xsl:choose>
3154
- <xsl:when test="$language = 'English'">en</xsl:when>
3155
- <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3156
- </xsl:choose>
3157
- </xsl:template><xsl:template name="capitalizeWords">
3158
- <xsl:param name="str"/>
3159
- <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
3160
- <xsl:choose>
3161
- <xsl:when test="contains($str2, ' ')">
3162
- <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3163
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3164
- <xsl:value-of select="substring($substr, 2)"/> -->
3165
- <xsl:call-template name="capitalize">
3166
- <xsl:with-param name="str" select="$substr"/>
3167
- </xsl:call-template>
3168
- <xsl:text> </xsl:text>
3169
- <xsl:call-template name="capitalizeWords">
3170
- <xsl:with-param name="str" select="substring-after($str2, ' ')"/>
3171
- </xsl:call-template>
3579
+ <xsl:when test="$language = 'zh'">
3580
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3581
+ </xsl:when>
3582
+ <xsl:when test="../../@inline-header = 'true'">
3583
+ <fo:inline font-size="90%">
3584
+ <xsl:call-template name="insertNonBreakSpaces">
3585
+ <xsl:with-param name="count" select="$padding-right"/>
3586
+ </xsl:call-template>
3587
+ </fo:inline>
3172
3588
  </xsl:when>
3173
3589
  <xsl:otherwise>
3174
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3175
- <xsl:value-of select="substring($str2, 2)"/> -->
3176
- <xsl:call-template name="capitalize">
3177
- <xsl:with-param name="str" select="$str2"/>
3178
- </xsl:call-template>
3590
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3179
3591
  </xsl:otherwise>
3180
3592
  </xsl:choose>
3181
- </xsl:template><xsl:template name="capitalize">
3182
- <xsl:param name="str"/>
3183
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3184
- <xsl:value-of select="substring($str, 2)"/>
3185
- </xsl:template><xsl:template match="mathml:math">
3186
- <fo:inline font-family="STIX2Math">
3187
- <fo:instream-foreign-object fox:alt-text="Math">
3188
- <xsl:copy-of select="."/>
3189
- </fo:instream-foreign-object>
3190
- </fo:inline>
3191
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
3192
- <xsl:for-each select="*[local-name()='locality']">
3193
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3194
- <xsl:apply-templates select="."/>
3195
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3196
- </xsl:for-each>
3197
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
3198
- <xsl:variable name="target">
3199
- <xsl:choose>
3200
- <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
3201
- <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
3202
- </xsl:when>
3203
- <xsl:otherwise>
3204
- <xsl:value-of select="normalize-space(@target)"/>
3205
- </xsl:otherwise>
3206
- </xsl:choose>
3593
+
3594
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3595
+ <xsl:param name="count"/>
3596
+ <xsl:if test="$count &gt; 0">
3597
+ <xsl:text> </xsl:text>
3598
+ <xsl:call-template name="insertNonBreakSpaces">
3599
+ <xsl:with-param name="count" select="$count - 1"/>
3600
+ </xsl:call-template>
3601
+ </xsl:if>
3602
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3603
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3604
+ <xsl:text> </xsl:text>
3605
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3606
+ <fo:block xsl:use-attribute-sets="admitted-style">
3607
+ <xsl:apply-templates/>
3608
+ </fo:block>
3609
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3610
+ <xsl:variable name="title-deprecated">
3611
+ <xsl:call-template name="getTitle">
3612
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3613
+ </xsl:call-template>
3207
3614
  </xsl:variable>
3208
- <fo:inline xsl:use-attribute-sets="link-style">
3615
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3616
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3617
+ </fo:block>
3618
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3619
+ <fo:block xsl:use-attribute-sets="definition-style">
3620
+ <xsl:apply-templates/>
3621
+ </fo:block>
3622
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3623
+ <xsl:apply-templates/>
3624
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3625
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3626
+ <fo:block> </fo:block>
3627
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3628
+
3629
+ <fo:block>
3630
+ <xsl:call-template name="setId"/>
3631
+
3632
+
3633
+
3634
+
3635
+
3636
+
3637
+
3638
+
3639
+
3640
+
3641
+ <xsl:apply-templates/>
3642
+ </fo:block>
3643
+
3644
+
3645
+
3646
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3647
+ <fo:block break-after="page"/>
3648
+ <fo:block>
3649
+ <xsl:call-template name="setId"/>
3650
+ <xsl:apply-templates/>
3651
+ </fo:block>
3652
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3653
+ <fo:block>
3654
+ <xsl:call-template name="setId"/>
3655
+ <xsl:apply-templates/>
3656
+ </fo:block>
3657
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3658
+ <fo:block id="{@id}">
3659
+ <xsl:apply-templates/>
3660
+ </fo:block>
3661
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3662
+
3663
+ <fo:block id="{@id}">
3664
+ <xsl:apply-templates/>
3665
+ </fo:block>
3666
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3667
+ <fo:block break-after="page"/>
3668
+ <fo:block id="{@id}">
3669
+
3670
+ </fo:block>
3671
+ <xsl:apply-templates/>
3672
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3673
+ <!-- comment 2019-11-29 -->
3674
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3675
+ <xsl:apply-templates /> -->
3676
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3677
+ <!-- 0xA0 to space replacement -->
3678
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3679
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3680
+ <fo:block-container margin-left="0mm">
3681
+ <xsl:if test="parent::*[local-name() = 'note']">
3682
+ <xsl:attribute name="margin-left">
3683
+ <xsl:choose>
3684
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3685
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3686
+ </xsl:choose>
3687
+ </xsl:attribute>
3688
+
3689
+ </xsl:if>
3690
+ <fo:block-container margin-left="0mm">
3691
+ <xsl:apply-templates select="." mode="ul_ol"/>
3692
+ </fo:block-container>
3693
+ </fo:block-container>
3694
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3695
+ <!-- <row>
3696
+ <date>05-07-2013</date>
3697
+ <type>Editorial</type>
3698
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3699
+ <pages>D-3</pages>
3700
+ </row>
3701
+ -->
3702
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3703
+ <fo:table-column column-width="20mm"/>
3704
+ <fo:table-column column-width="23mm"/>
3705
+ <fo:table-column column-width="107mm"/>
3706
+ <fo:table-column column-width="15mm"/>
3707
+ <fo:table-body>
3708
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3709
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3710
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3711
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3712
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3713
+ </fo:table-row>
3714
+ <xsl:apply-templates/>
3715
+ </fo:table-body>
3716
+ </fo:table>
3717
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3718
+ <fo:table-row>
3719
+ <xsl:apply-templates/>
3720
+ </fo:table-row>
3721
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3722
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3723
+ <fo:block><xsl:apply-templates/></fo:block>
3724
+ </fo:table-cell>
3725
+ </xsl:template><xsl:template name="processBibitem">
3726
+
3727
+
3728
+
3729
+
3730
+ <!-- start IHO bibtem processing -->
3209
3731
  <xsl:choose>
3210
- <xsl:when test="$target = ''">
3211
- <xsl:apply-templates/>
3732
+ <xsl:when test="iho:formattedref">
3733
+ <xsl:apply-templates select="iho:formattedref"/>
3212
3734
  </xsl:when>
3213
3735
  <xsl:otherwise>
3214
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
3736
+ <xsl:choose>
3737
+ <!-- IHO documents -->
3738
+ <!-- {docID} edition {edition}: {title}, {author/organization} -->
3739
+ <xsl:when test="iho:docidentifier[1]/@type='IHO'">
3740
+ <xsl:value-of select="iho:docidentifier[1]"/>
3741
+ <xsl:apply-templates select="iho:edition"/>
3742
+ <xsl:if test="iho:title or iho:contributor or iho:url">
3743
+ <xsl:text>: </xsl:text>
3744
+ </xsl:if>
3745
+ </xsl:when>
3746
+
3747
+ <!-- Non-IHO documents -->
3748
+ <!-- title and publisher -->
3749
+ <xsl:otherwise>
3750
+ <xsl:variable name="docID">
3751
+ <xsl:call-template name="processBibitemDocId"/>
3752
+ </xsl:variable>
3753
+ <xsl:value-of select="normalize-space($docID)"/>
3754
+ <xsl:if test="normalize-space($docID) != ''"><xsl:text>: </xsl:text></xsl:if>
3755
+ </xsl:otherwise>
3756
+ </xsl:choose>
3757
+
3758
+ <xsl:choose>
3759
+ <xsl:when test="iho:title[@type = 'main' and @language = 'en']">
3760
+ <xsl:apply-templates select="iho:title[@type = 'main' and @language = 'en']"/>
3761
+ </xsl:when>
3762
+ <xsl:otherwise>
3763
+ <xsl:apply-templates select="iho:title"/>
3764
+ </xsl:otherwise>
3765
+ </xsl:choose>
3766
+
3767
+ <xsl:if test="iho:title and iho:contributor">
3768
+ <xsl:text>, </xsl:text>
3769
+ </xsl:if>
3770
+
3771
+ <xsl:variable name="authors">
3215
3772
  <xsl:choose>
3216
- <xsl:when test="normalize-space(.) = ''">
3217
- <xsl:value-of select="$target"/>
3773
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
3774
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
3775
+ <xsl:copy-of select="."/>
3776
+ </xsl:for-each>
3218
3777
  </xsl:when>
3219
- <xsl:otherwise>
3220
- <xsl:apply-templates/>
3778
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
3779
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
3780
+ <xsl:copy-of select="."/>
3781
+ </xsl:for-each>
3782
+ </xsl:when>
3783
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
3784
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
3785
+ <xsl:copy>
3786
+ <xsl:choose>
3787
+ <xsl:when test="position() != 1 and position() != last()">, </xsl:when>
3788
+ <xsl:when test="position() != 1 and position() = last()"> and </xsl:when>
3789
+ </xsl:choose>
3790
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
3791
+ </xsl:copy>
3792
+ </xsl:for-each>
3793
+ </xsl:when>
3794
+ </xsl:choose>
3795
+ </xsl:variable>
3796
+
3797
+ <xsl:for-each select="xalan:nodeset($authors)/*">
3798
+ <xsl:choose>
3799
+ <xsl:when test="not(*[local-name() = 'role'])"><!-- publisher organisation -->
3800
+ <xsl:value-of select="."/>
3801
+ </xsl:when>
3802
+ <xsl:otherwise> <!-- author, editor -->
3803
+ <xsl:choose>
3804
+ <xsl:when test="*[local-name() = 'organization']/*[local-name() = 'name']">
3805
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
3806
+ </xsl:when>
3807
+ <xsl:otherwise>
3808
+ <xsl:for-each select="*[local-name() = 'person']">
3809
+ <xsl:variable name="author">
3810
+ <xsl:call-template name="processPersonalAuthor"/>
3811
+ </xsl:variable>
3812
+ <xsl:value-of select="xalan:nodeset($author)/author"/>
3813
+ </xsl:for-each>
3814
+ </xsl:otherwise>
3815
+ </xsl:choose>
3221
3816
  </xsl:otherwise>
3222
3817
  </xsl:choose>
3223
- </fo:basic-link>
3818
+ <xsl:if test="*[local-name() = 'organization']/*[local-name() = 'name'] and position() != last()">
3819
+ <xsl:text>, </xsl:text>
3820
+ </xsl:if>
3821
+ </xsl:for-each>
3822
+
3823
+ <xsl:apply-templates select="*[local-name() = 'uri'][1]"/>
3824
+
3224
3825
  </xsl:otherwise>
3225
3826
  </xsl:choose>
3226
- </fo:inline>
3227
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3228
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3229
- <!-- <xsl:choose>
3230
- <xsl:when test="@lang = 'en'"></xsl:when>
3231
- <xsl:otherwise> -->
3232
- <xsl:attribute name="white-space">pre</xsl:attribute>
3233
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3234
- <!-- </xsl:otherwise>
3235
- </xsl:choose> -->
3236
- <xsl:apply-templates/>
3237
- </fo:block>
3238
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
3239
- <fo:inline id="{@id}"/>
3240
- </xsl:template><xsl:template match="*[local-name()='appendix']">
3241
- <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3242
- <xsl:variable name="title-appendix">
3243
- <xsl:call-template name="getTitle">
3244
- <xsl:with-param name="name" select="'title-appendix'"/>
3245
- </xsl:call-template>
3246
- </xsl:variable>
3247
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3248
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3249
- </fo:block>
3250
- <xsl:apply-templates/>
3251
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3252
- <fo:inline><xsl:apply-templates/></fo:inline>
3253
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3254
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3255
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3256
- <xsl:variable name="title-example">
3257
- <xsl:call-template name="getTitle">
3258
- <xsl:with-param name="name" select="'title-example'"/>
3259
- </xsl:call-template>
3260
- </xsl:variable>
3261
- <xsl:value-of select="$title-example"/>
3262
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3263
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3827
+ <!-- end IHO bibitem processing -->
3828
+
3829
+ </xsl:template><xsl:template name="processBibitemDocId">
3830
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
3831
+ <xsl:choose>
3832
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3833
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
3834
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3835
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3264
3836
  </xsl:if>
3265
- <xsl:if test="*[local-name()='name']">
3266
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3267
- </xsl:if>
3268
- </fo:block>
3269
- <xsl:apply-templates/>
3270
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']"/><xsl:template match="*[local-name()='appendix']//*[local-name()='example']/*[local-name()='name']" mode="process">
3271
- <fo:inline><xsl:apply-templates/></fo:inline>
3272
- </xsl:template><xsl:template match="*[local-name() = 'callout']">
3273
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3274
- </xsl:template><xsl:template match="*[local-name() = 'annotation']">
3275
- <xsl:variable name="annotation-id" select="@id"/>
3276
- <xsl:variable name="callout" select="//*[@target = $annotation-id]/text()"/>
3277
- <fo:block id="{$annotation-id}" white-space="nowrap">
3278
- <fo:inline>
3279
- <xsl:apply-templates>
3280
- <xsl:with-param name="callout" select="concat('&lt;', $callout, '&gt; ')"/>
3281
- </xsl:apply-templates>
3282
- </fo:inline>
3283
- </fo:block>
3284
- </xsl:template><xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
3285
- <xsl:param name="callout"/>
3286
- <fo:inline id="{@id}">
3287
- <!-- for first p in annotation, put <x> -->
3288
- <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3289
- <xsl:apply-templates/>
3290
- </fo:inline>
3291
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3292
- <xsl:variable name="title-modified">
3293
- <xsl:call-template name="getTitle">
3294
- <xsl:with-param name="name" select="'title-modified'"/>
3295
- </xsl:call-template>
3296
- </xsl:variable>
3837
+ <xsl:value-of select="$_doc_ident"/>
3838
+ </xsl:when>
3839
+ <xsl:otherwise>
3840
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3841
+ <xsl:if test="$type != ''">
3842
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3843
+ </xsl:if>
3844
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3845
+ </xsl:otherwise>
3846
+ </xsl:choose>
3847
+ </xsl:template><xsl:template name="processPersonalAuthor">
3297
3848
  <xsl:choose>
3298
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3299
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3849
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3850
+ <author>
3851
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3852
+ </author>
3853
+ </xsl:when>
3854
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3855
+ <author>
3856
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3857
+ <xsl:text> </xsl:text>
3858
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3859
+ </author>
3860
+ </xsl:when>
3861
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3862
+ <author>
3863
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3864
+ <xsl:text> </xsl:text>
3865
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3866
+ </author>
3867
+ </xsl:when>
3868
+ <xsl:otherwise>
3869
+ <xsl:apply-templates/>
3870
+ </xsl:otherwise>
3300
3871
  </xsl:choose>
3301
- <xsl:apply-templates/>
3872
+ </xsl:template><xsl:template name="renderDate">
3873
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3874
+ <xsl:value-of select="*[local-name() = 'on']"/>
3875
+ </xsl:if>
3876
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3877
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3878
+ </xsl:if>
3879
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3880
+ <xsl:value-of select="translate(.,'. ','')"/>
3881
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3882
+ <xsl:value-of select="substring(.,1,1)"/>
3302
3883
  </xsl:template><xsl:template name="convertDate">
3303
3884
  <xsl:param name="date"/>
3304
3885
  <xsl:param name="format" select="'short'"/>
@@ -3431,27 +4012,49 @@
3431
4012
  </xsl:otherwise>
3432
4013
  </xsl:choose>
3433
4014
  </xsl:template><xsl:template name="getLevel">
3434
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3435
- <xsl:variable name="level">
3436
- <xsl:choose>
3437
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3438
- <xsl:value-of select="$level_total - 2"/>
3439
- </xsl:when>
3440
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3441
- <xsl:value-of select="$level_total - 2"/>
3442
- </xsl:when>
3443
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3444
- <xsl:value-of select="$level_total - 2"/>
3445
- </xsl:when>
3446
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3447
- <xsl:otherwise>
3448
- <xsl:value-of select="$level_total - 1"/>
3449
- </xsl:otherwise>
3450
- </xsl:choose>
3451
- </xsl:variable>
3452
- <xsl:value-of select="$level"/>
3453
- </xsl:template><xsl:template name="getSubSection">
3454
- <xsl:number format=".1" level="multiple" count="*[local-name() = 'clause']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'terms'] | *[local-name() = 'terms']/*[local-name() = 'term'] | *[local-name() = 'clause']/*[local-name() = 'term'] | *[local-name() = 'terms']/*[local-name() = 'clause'] | *[local-name() = 'terms']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'clause'] | *[local-name() = 'clause']/*[local-name() = 'definitions'] | *[local-name() = 'definitions']/*[local-name() = 'definitions'] | *[local-name() = 'clause']/*[local-name() = 'references']"/>
4015
+ <xsl:param name="depth"/>
4016
+ <xsl:choose>
4017
+ <xsl:when test="normalize-space(@depth) != ''">
4018
+ <xsl:value-of select="@depth"/>
4019
+ </xsl:when>
4020
+ <xsl:when test="normalize-space($depth) != ''">
4021
+ <xsl:value-of select="$depth"/>
4022
+ </xsl:when>
4023
+ <xsl:otherwise>
4024
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
4025
+ <xsl:variable name="level">
4026
+ <xsl:choose>
4027
+ <xsl:when test="parent::*[local-name() = 'preface']">
4028
+ <xsl:value-of select="$level_total - 1"/>
4029
+ </xsl:when>
4030
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
4031
+ <xsl:value-of select="$level_total - 2"/>
4032
+ </xsl:when>
4033
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
4034
+ <xsl:value-of select="$level_total - 1"/>
4035
+ </xsl:when> -->
4036
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
4037
+ <xsl:value-of select="$level_total - 1"/>
4038
+ </xsl:when>
4039
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
4040
+ <xsl:value-of select="$level_total - 1"/>
4041
+ </xsl:when>
4042
+ <xsl:when test="parent::*[local-name() = 'annex']">
4043
+ <xsl:value-of select="$level_total - 1"/>
4044
+ </xsl:when>
4045
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
4046
+ <xsl:value-of select="$level_total"/>
4047
+ </xsl:when>
4048
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
4049
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
4050
+ <xsl:otherwise>
4051
+ <xsl:value-of select="$level_total - 1"/>
4052
+ </xsl:otherwise>
4053
+ </xsl:choose>
4054
+ </xsl:variable>
4055
+ <xsl:value-of select="$level"/>
4056
+ </xsl:otherwise>
4057
+ </xsl:choose>
3455
4058
  </xsl:template><xsl:template name="split">
3456
4059
  <xsl:param name="pText" select="."/>
3457
4060
  <xsl:param name="sep" select="','"/>
@@ -3482,7 +4085,8 @@
3482
4085
 
3483
4086
  <xsl:value-of select="document('')//*/namespace::iho"/>
3484
4087
 
3485
-
4088
+
4089
+
3486
4090
  </xsl:variable>
3487
4091
  <xsl:if test="$documentNS != $XSLNS">
3488
4092
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3497,4 +4101,15 @@
3497
4101
  <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3498
4102
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3499
4103
  </xsl:choose>
4104
+ </xsl:template><xsl:template name="setId">
4105
+ <xsl:attribute name="id">
4106
+ <xsl:choose>
4107
+ <xsl:when test="@id">
4108
+ <xsl:value-of select="@id"/>
4109
+ </xsl:when>
4110
+ <xsl:otherwise>
4111
+ <xsl:value-of select="generate-id()"/>
4112
+ </xsl:otherwise>
4113
+ </xsl:choose>
4114
+ </xsl:attribute>
3500
4115
  </xsl:template></xsl:stylesheet>