metanorma-iho 0.1.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
397
  </xsl:template>
493
398
 
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
- </xsl:template>
523
-
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,31 @@
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
-
885
- <xsl:template match="iho:figure/iho:name" mode="figure_name">
886
- <xsl:apply-templates/>
887
- </xsl:template>
888
-
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}" -->
906
- </fo:block>
907
- </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>
964
- <xsl:apply-templates/>
965
- </fo:block>
966
- </xsl:template>
967
-
968
610
 
969
611
  <xsl:template match="iho:ul | iho:ol">
970
612
  <fo:list-block provisional-distance-between-starts="6mm">
971
613
  <xsl:apply-templates/>
972
614
  </fo:list-block>
973
- <xsl:for-each select="./iho:note//iho:p">
615
+ <xsl:for-each select="./iho:note">
974
616
  <xsl:call-template name="note"/>
975
617
  </xsl:for-each>
976
618
  </xsl:template>
977
619
 
978
- <xsl:template match="iho:ul//iho:note | iho:ol//iho:note"/>
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"/>
625
+ </fo:block>
626
+ </xsl:template>
627
+ <xsl:template match="iho:ul//iho:note/iho:name | iho:ol//iho:note/iho:name" mode="process"/>
628
+ <xsl:template match="iho:ul//iho:note/iho:p | iho:ol//iho:note/iho:p" mode="process">
629
+ <fo:block font-size="11pt" margin-top="4pt">
630
+ <xsl:apply-templates/>
631
+ </fo:block>
632
+ </xsl:template>
633
+
634
+
979
635
 
980
636
  <xsl:template match="iho:li">
981
637
  <fo:list-item id="{@id}" margin-bottom="12pt">
@@ -985,8 +641,10 @@
985
641
  </fo:block>
986
642
  </fo:list-item-label>
987
643
  <fo:list-item-body start-indent="body-start()">
988
- <xsl:apply-templates/>
989
- <xsl:apply-templates select=".//iho:note" mode="process"/>
644
+ <fo:block>
645
+ <xsl:apply-templates/>
646
+ <xsl:apply-templates select=".//iho:note" mode="process"/>
647
+ </fo:block>
990
648
  </fo:list-item-body>
991
649
  </fo:list-item>
992
650
  </xsl:template>
@@ -1002,27 +660,7 @@
1002
660
  </xsl:choose>
1003
661
  </xsl:template>
1004
662
 
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>
663
+
1026
664
 
1027
665
  <xsl:template match="iho:admonition">
1028
666
  <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,127 +675,19 @@
1037
675
  </fo:block-container>
1038
676
  </xsl:template>
1039
677
 
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
-
678
+
1052
679
  <xsl:template match="iho:formula/iho:stem">
1053
680
  <fo:block margin-top="6pt" margin-bottom="12pt" text-align="center">
1054
681
  <xsl:apply-templates/>
1055
682
  </fo:block>
1056
683
  </xsl:template>
1057
684
 
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
685
 
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/>
686
+
687
+ <xsl:template match="iho:references"><!-- [position() &gt; 1] -->
688
+ <fo:block id="{@id}">
689
+ <xsl:apply-templates/>
690
+ </fo:block>
1161
691
  </xsl:template>
1162
692
 
1163
693
  <!-- Example: [1] IHO S-100, Universal Hydrographic Data Model v4.0.0, December 2018 (Encoding, Feature Catalogue) -->
@@ -1205,7 +735,7 @@
1205
735
  </fo:inline>
1206
736
  </xsl:template>
1207
737
 
1208
- <xsl:template match="iho:bibitem/iho:note">
738
+ <xsl:template match="iho:bibitem/iho:note" priority="2">
1209
739
  <fo:footnote>
1210
740
  <xsl:variable name="number">
1211
741
  <xsl:number level="any" count="iho:bibitem/iho:note"/>
@@ -1226,38 +756,10 @@
1226
756
  </fo:footnote>
1227
757
  </xsl:template>
1228
758
 
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
759
 
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
760
 
1259
- <xsl:template match="iho:example/iho:p">
1260
- <fo:block-container font-size="11pt" margin-left="12.7mm">
761
+ <xsl:template match="iho:example/iho:p" priority="2">
762
+ <fo:block-container xsl:use-attribute-sets="example-p-style">
1261
763
  <fo:block-container margin-left="0mm">
1262
764
  <fo:block>
1263
765
  <xsl:apply-templates/>
@@ -1266,32 +768,7 @@
1266
768
  </fo:block-container>
1267
769
  </xsl:template>
1268
770
 
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>
771
+
1295
772
 
1296
773
  <xsl:template match="iho:pagebreak">
1297
774
  <xsl:copy-of select="."/>
@@ -1300,30 +777,12 @@
1300
777
  <!-- https://github.com/metanorma/mn-native-pdf/issues/214 -->
1301
778
  <xsl:template match="iho:index"/>
1302
779
 
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
780
 
1314
781
  <xsl:template match="iho:preferred">
1315
- <xsl:param name="sectionNum"/>
782
+
1316
783
  <fo:block line-height="1.1">
1317
784
  <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>
785
+ <xsl:apply-templates select="ancestor::iho:term/iho:name" mode="presentation"/>
1327
786
  </fo:block>
1328
787
  <fo:block font-weight="bold" keep-with-next="always">
1329
788
  <xsl:apply-templates/>
@@ -1331,122 +790,9 @@
1331
790
  </fo:block>
1332
791
  </xsl:template>
1333
792
 
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
793
 
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
-
1384
-
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
794
 
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
795
 
1449
-
1450
796
  <xsl:template name="insertHeaderFooter">
1451
797
  <xsl:param name="font-weight" select="'bold'"/>
1452
798
  <fo:static-content flow-name="header-odd">
@@ -1491,127 +837,6 @@
1491
837
  </fo:static-content>
1492
838
  </xsl:template>
1493
839
 
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
840
 
1616
841
  <xsl:template name="getListItemFormat">
1617
842
  <xsl:choose>
@@ -1709,46 +934,6 @@
1709
934
  </xsl:variable>
1710
935
 
1711
936
  <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
937
 
1753
938
  <title-annex lang="en">Annex </title-annex>
1754
939
  <title-annex lang="fr">Annexe </title-annex>
@@ -1756,17 +941,7 @@
1756
941
  <title-annex lang="zh">Annex </title-annex>
1757
942
 
1758
943
 
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
-
944
+
1770
945
  <title-edition lang="en">
1771
946
 
1772
947
  <xsl:text>Edition </xsl:text>
@@ -1774,9 +949,7 @@
1774
949
 
1775
950
  </title-edition>
1776
951
 
1777
- <title-formula lang="en">Formula </title-formula>
1778
- <title-formula lang="fr">Formula </title-formula>
1779
-
952
+
1780
953
  <title-toc lang="en">
1781
954
 
1782
955
  <xsl:text>Contents</xsl:text>
@@ -1811,13 +984,6 @@
1811
984
  </title-part>
1812
985
  <title-part lang="zh">第 # 部分:</title-part>
1813
986
 
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
987
  <title-modified lang="en">modified</title-modified>
1822
988
  <title-modified lang="fr">modifiée</title-modified>
1823
989
 
@@ -1831,14 +997,12 @@
1831
997
 
1832
998
  <title-deprecated lang="en">DEPRECATED</title-deprecated>
1833
999
  <title-deprecated lang="fr">DEPRECATED</title-deprecated>
1834
-
1835
- <title-submitting-organizations lang="en">Submitting Organizations</title-submitting-organizations>
1836
-
1000
+
1837
1001
  <title-list-tables lang="en">List of Tables</title-list-tables>
1838
1002
 
1839
1003
  <title-list-figures lang="en">List of Figures</title-list-figures>
1840
1004
 
1841
- <title-recommendation lang="en">Recommendation </title-recommendation>
1005
+ <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
1842
1006
 
1843
1007
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
1844
1008
 
@@ -1848,8 +1012,6 @@
1848
1012
 
1849
1013
  <title-in lang="en">in </title-in>
1850
1014
 
1851
- <title-box lang="en">Box </title-box>
1852
-
1853
1015
  <title-partly-supercedes lang="en">Partly Supercedes </title-partly-supercedes>
1854
1016
  <title-partly-supercedes lang="zh">部分代替 </title-partly-supercedes>
1855
1017
 
@@ -1872,7 +1034,7 @@
1872
1034
  <title-warning lang="zh">警告</title-warning>
1873
1035
 
1874
1036
  <title-amendment lang="en">AMENDMENT</title-amendment>
1875
- </xsl:variable><xsl:template name="getTitle">
1037
+ </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1876
1038
  <xsl:param name="name"/>
1877
1039
  <xsl:variable name="lang">
1878
1040
  <xsl:call-template name="getLang"/>
@@ -1893,6 +1055,8 @@
1893
1055
 
1894
1056
 
1895
1057
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1058
+ <xsl:attribute name="white-space">pre</xsl:attribute>
1059
+ <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1896
1060
 
1897
1061
 
1898
1062
 
@@ -1907,6 +1071,123 @@
1907
1071
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1908
1072
  <xsl:attribute name="line-height">113%</xsl:attribute>
1909
1073
 
1074
+ </xsl:attribute-set><xsl:attribute-set name="permission-style">
1075
+
1076
+ </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
1077
+
1078
+ </xsl:attribute-set><xsl:attribute-set name="permission-label-style">
1079
+
1080
+ </xsl:attribute-set><xsl:attribute-set name="requirement-style">
1081
+
1082
+ </xsl:attribute-set><xsl:attribute-set name="requirement-name-style">
1083
+
1084
+ </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1085
+
1086
+ </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1087
+ </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1088
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1089
+
1090
+
1091
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-name-style">
1092
+
1093
+
1094
+ </xsl:attribute-set><xsl:attribute-set name="recommendation-label-style">
1095
+
1096
+ </xsl:attribute-set><xsl:attribute-set name="termexample-style">
1097
+
1098
+
1099
+
1100
+
1101
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1102
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1103
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1104
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1105
+
1106
+
1107
+
1108
+
1109
+ </xsl:attribute-set><xsl:attribute-set name="example-style">
1110
+
1111
+
1112
+
1113
+
1114
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1115
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1116
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+ </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1125
+
1126
+
1127
+
1128
+ </xsl:attribute-set><xsl:attribute-set name="example-name-style">
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1135
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+
1146
+
1147
+
1148
+
1149
+ </xsl:attribute-set><xsl:attribute-set name="example-p-style">
1150
+
1151
+
1152
+
1153
+
1154
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1155
+ <xsl:attribute name="margin-left">12.7mm</xsl:attribute>
1156
+
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+ </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
1167
+
1168
+
1169
+
1170
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1171
+
1172
+
1173
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1174
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1175
+
1176
+
1177
+
1178
+
1179
+ <xsl:attribute name="text-align">center</xsl:attribute>
1180
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1181
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1182
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+
1910
1191
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1911
1192
 
1912
1193
 
@@ -1915,7 +1196,218 @@
1915
1196
 
1916
1197
 
1917
1198
 
1918
- </xsl:attribute-set><xsl:template match="text()">
1199
+ </xsl:attribute-set><xsl:attribute-set name="xref-style">
1200
+
1201
+
1202
+ <xsl:attribute name="color">blue</xsl:attribute>
1203
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1204
+
1205
+ </xsl:attribute-set><xsl:attribute-set name="eref-style">
1206
+
1207
+
1208
+
1209
+ </xsl:attribute-set><xsl:attribute-set name="note-style">
1210
+
1211
+
1212
+
1213
+
1214
+
1215
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1216
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1217
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1218
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+
1225
+
1226
+
1227
+
1228
+
1229
+
1230
+ </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1231
+
1232
+
1233
+
1234
+
1235
+
1236
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1237
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
1238
+
1239
+
1240
+
1241
+
1242
+
1243
+
1244
+ </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1245
+
1246
+
1247
+
1248
+
1249
+
1250
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1251
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1252
+
1253
+
1254
+
1255
+
1256
+
1257
+
1258
+
1259
+
1260
+
1261
+ </xsl:attribute-set><xsl:attribute-set name="termnote-style">
1262
+
1263
+
1264
+
1265
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1266
+ <xsl:attribute name="margin-top">8pt</xsl:attribute>
1267
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
1268
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1269
+
1270
+
1271
+
1272
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1273
+
1274
+
1275
+
1276
+
1277
+ <xsl:attribute name="margin-left">12.5mm</xsl:attribute>
1278
+ <xsl:attribute name="margin-right">14mm</xsl:attribute>
1279
+
1280
+
1281
+
1282
+ </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1283
+
1284
+
1285
+ <xsl:attribute name="text-align">right</xsl:attribute>
1286
+
1287
+
1288
+ </xsl:attribute-set><xsl:attribute-set name="termsource-style">
1289
+
1290
+
1291
+
1292
+
1293
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1294
+
1295
+
1296
+ </xsl:attribute-set><xsl:attribute-set name="origin-style">
1297
+
1298
+
1299
+ <xsl:attribute name="color">blue</xsl:attribute>
1300
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
1301
+
1302
+ </xsl:attribute-set><xsl:attribute-set name="term-style">
1303
+
1304
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
1305
+
1306
+ </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1314
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1315
+ <xsl:attribute name="text-align">center</xsl:attribute>
1316
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1317
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1318
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1319
+
1320
+
1321
+
1322
+
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+ </xsl:attribute-set><xsl:attribute-set name="formula-style">
1331
+
1332
+ </xsl:attribute-set><xsl:attribute-set name="image-style">
1333
+ <xsl:attribute name="text-align">center</xsl:attribute>
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+ </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1340
+
1341
+ </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1342
+
1343
+ <xsl:attribute name="width">100%</xsl:attribute>
1344
+ <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1345
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1346
+
1347
+
1348
+
1349
+
1350
+
1351
+ </xsl:attribute-set><xsl:attribute-set name="tt-style">
1352
+
1353
+
1354
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1355
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1356
+
1357
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1358
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1359
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1360
+ <xsl:attribute name="text-align">center</xsl:attribute>
1361
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1362
+ </xsl:attribute-set><xsl:attribute-set name="domain-style">
1363
+
1364
+ </xsl:attribute-set><xsl:attribute-set name="admitted-style">
1365
+
1366
+
1367
+ </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
1368
+
1369
+ </xsl:attribute-set><xsl:attribute-set name="definition-style">
1370
+
1371
+
1372
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1373
+
1374
+ </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
1375
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1376
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1377
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1378
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1379
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1380
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1381
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1382
+
1383
+ <!-- Normative references -->
1384
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1385
+ <!-- Terms and definitions -->
1386
+ <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"/>
1387
+ <!-- Another main sections -->
1388
+ <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"/>
1389
+ <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1390
+ <!-- Bibliography -->
1391
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1392
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1393
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1394
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1395
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1396
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1397
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1398
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1399
+ <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1400
+
1401
+ <!-- Normative references -->
1402
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1403
+ <!-- Terms and definitions -->
1404
+ <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']]"/>
1405
+ <!-- Another main sections -->
1406
+ <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'])]"/>
1407
+ <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1408
+ <!-- Bibliography -->
1409
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1410
+ </xsl:template><xsl:template match="text()">
1919
1411
  <xsl:value-of select="."/>
1920
1412
  </xsl:template><xsl:template match="*[local-name()='br']">
1921
1413
  <xsl:value-of select="$linebreak"/>
@@ -1924,65 +1416,21 @@
1924
1416
  <xsl:call-template name="add-zero-spaces-java"/>
1925
1417
  </xsl:template><xsl:template match="*[local-name()='table']">
1926
1418
 
1927
- <xsl:variable name="simple-table">
1928
- <!-- <xsl:copy> -->
1929
- <xsl:call-template name="getSimpleTable"/>
1930
- <!-- </xsl:copy> -->
1419
+ <xsl:variable name="simple-table">
1420
+ <xsl:call-template name="getSimpleTable"/>
1931
1421
  </xsl:variable>
1932
1422
 
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(/*), '-')"/> -->
1938
1423
 
1939
- <!-- <xsl:if test="$namespace = 'iso'">
1940
- <fo:block space-before="6pt">&#xA0;</fo:block>
1941
- </xsl:if> -->
1942
1424
 
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"/>
1425
+
1426
+
1427
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1428
+
1983
1429
 
1984
- </xsl:otherwise>
1985
- </xsl:choose>
1430
+
1431
+ <xsl:call-template name="fn_name_display"/>
1432
+
1433
+
1986
1434
 
1987
1435
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
1988
1436
 
@@ -2042,6 +1490,7 @@
2042
1490
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2043
1491
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
2044
1492
 
1493
+
2045
1494
  <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
1495
 
2047
1496
 
@@ -2057,6 +1506,7 @@
2057
1506
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2058
1507
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
2059
1508
 
1509
+
2060
1510
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2061
1511
  <xsl:choose>
2062
1512
  <xsl:when test=". = 1 or . = 0">
@@ -2081,32 +1531,15 @@
2081
1531
 
2082
1532
 
2083
1533
 
1534
+
1535
+
2084
1536
  </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
-
2097
-
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/>
1537
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1538
+ <xsl:if test="normalize-space() != ''">
1539
+ <fo:block xsl:use-attribute-sets="table-name-style">
1540
+ <xsl:apply-templates/>
1541
+ </fo:block>
1542
+ </xsl:if>
2110
1543
  </xsl:template><xsl:template name="calculate-columns-numbers">
2111
1544
  <xsl:param name="table-row"/>
2112
1545
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2324,6 +1757,16 @@
2324
1757
  </fo:table-row>
2325
1758
  </xsl:template><xsl:template match="*[local-name()='th']">
2326
1759
  <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
1760
+ <xsl:attribute name="text-align">
1761
+ <xsl:choose>
1762
+ <xsl:when test="@align">
1763
+ <xsl:value-of select="@align"/>
1764
+ </xsl:when>
1765
+ <xsl:otherwise>center</xsl:otherwise>
1766
+ </xsl:choose>
1767
+ </xsl:attribute>
1768
+
1769
+
2327
1770
 
2328
1771
 
2329
1772
 
@@ -2347,12 +1790,20 @@
2347
1790
  </fo:table-cell>
2348
1791
  </xsl:template><xsl:template match="*[local-name()='td']">
2349
1792
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1793
+ <xsl:attribute name="text-align">
1794
+ <xsl:choose>
1795
+ <xsl:when test="@align">
1796
+ <xsl:value-of select="@align"/>
1797
+ </xsl:when>
1798
+ <xsl:otherwise>left</xsl:otherwise>
1799
+ </xsl:choose>
1800
+ </xsl:attribute>
2350
1801
  <!-- and ancestor::*[local-name() = 'thead'] -->
2351
1802
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2352
1803
 
2353
1804
 
2354
1805
 
2355
-
1806
+
2356
1807
 
2357
1808
 
2358
1809
 
@@ -2371,21 +1822,9 @@
2371
1822
  <fo:block>
2372
1823
 
2373
1824
  <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
-
1825
+ </fo:block>
2387
1826
  </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">
1827
+ </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
1828
 
2390
1829
 
2391
1830
  <fo:block font-size="10pt" margin-bottom="12pt">
@@ -2398,28 +1837,18 @@
2398
1837
  <fo:inline padding-right="2mm">
2399
1838
 
2400
1839
 
2401
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1840
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
1841
+ <xsl:attribute name="padding-right">3mm</xsl:attribute>
2402
1842
 
2403
- <xsl:variable name="title-note">
2404
- <xsl:call-template name="getTitle">
2405
- <xsl:with-param name="name" select="'title-note'"/>
2406
- </xsl:call-template>
2407
- </xsl:variable>
2408
- <xsl:value-of select="$title-note"/>
2409
1843
 
2410
- <xsl:variable name="id" select="ancestor::*[local-name() = 'table'][1]/@id"/>
2411
- <xsl:if test="count(//*[local-name()='note'][ancestor::*[@id = $id]]) &gt; 1">
2412
- <xsl:number count="*[local-name()='note'][ancestor::*[@id = $id]]" level="any"/>
2413
- </xsl:if>
1844
+
1845
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2414
1846
 
2415
-
2416
-
2417
-
2418
1847
  </fo:inline>
2419
1848
  <xsl:apply-templates mode="process"/>
2420
1849
  </fo:block>
2421
1850
 
2422
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
1851
+ </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">
2423
1852
  <xsl:apply-templates/>
2424
1853
  </xsl:template><xsl:template name="fn_display">
2425
1854
  <xsl:variable name="references">
@@ -2479,7 +1908,7 @@
2479
1908
  <!-- and (not(@class) or @class !='pseudocode') -->
2480
1909
  </xsl:variable>
2481
1910
  <xsl:variable name="references">
2482
- <xsl:for-each select=".//*[local-name()='fn']">
1911
+ <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2483
1912
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2484
1913
  <xsl:apply-templates/>
2485
1914
  </fn>
@@ -2750,7 +2179,7 @@
2750
2179
  <xsl:value-of select="string-length(normalize-space(.))"/>
2751
2180
  </xsl:if>
2752
2181
  </xsl:for-each>
2753
- </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']">
2182
+ </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
2754
2183
  <xsl:param name="key_iso"/>
2755
2184
 
2756
2185
  <!-- <tr>
@@ -2766,12 +2195,7 @@
2766
2195
  <xsl:if test="normalize-space($key_iso) = 'true'">
2767
2196
  <xsl:attribute name="margin-top">0</xsl:attribute>
2768
2197
  </xsl:if>
2769
- <xsl:variable name="title-note">
2770
- <xsl:call-template name="getTitle">
2771
- <xsl:with-param name="name" select="'title-note'"/>
2772
- </xsl:call-template>
2773
- </xsl:variable>
2774
- <xsl:value-of select="$title-note"/>
2198
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2775
2199
  </fo:block>
2776
2200
  </fo:table-cell>
2777
2201
  <fo:table-cell>
@@ -2825,14 +2249,36 @@
2825
2249
  <fo:table-cell>
2826
2250
  <fo:block>
2827
2251
 
2828
-
2252
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2253
+ <xsl:if test="local-name(*[1]) != 'stem'">
2254
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2255
+ </xsl:if>
2256
+ </xsl:if> -->
2829
2257
 
2830
2258
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2831
2259
 
2832
2260
  </fo:block>
2833
2261
  </fo:table-cell>
2834
2262
  </fo:table-row>
2835
-
2263
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2264
+ <xsl:if test="local-name(*[1]) = 'stem'">
2265
+ <fo:table-row>
2266
+ <fo:table-cell>
2267
+ <fo:block margin-top="6pt">
2268
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2269
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2270
+ </xsl:if>
2271
+ <xsl:text>&#xA0;</xsl:text>
2272
+ </fo:block>
2273
+ </fo:table-cell>
2274
+ <fo:table-cell>
2275
+ <fo:block>
2276
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2277
+ </fo:block>
2278
+ </fo:table-cell>
2279
+ </fo:table-row>
2280
+ </xsl:if>
2281
+ </xsl:if> -->
2836
2282
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2837
2283
  <xsl:apply-templates/>
2838
2284
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2843,7 +2289,7 @@
2843
2289
  <fo:inline font-style="italic">
2844
2290
  <xsl:apply-templates/>
2845
2291
  </fo:inline>
2846
- </xsl:template><xsl:template match="*[local-name()='strong']">
2292
+ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
2847
2293
  <fo:inline font-weight="bold">
2848
2294
  <xsl:apply-templates/>
2849
2295
  </fo:inline>
@@ -2856,7 +2302,7 @@
2856
2302
  <xsl:apply-templates/>
2857
2303
  </fo:inline>
2858
2304
  </xsl:template><xsl:template match="*[local-name()='tt']">
2859
- <fo:inline font-family="Courier" font-size="10pt">
2305
+ <fo:inline xsl:use-attribute-sets="tt-style">
2860
2306
  <xsl:apply-templates/>
2861
2307
  </fo:inline>
2862
2308
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -3187,13 +2633,7 @@
3187
2633
  <xsl:copy-of select="."/>
3188
2634
  </fo:instream-foreign-object>
3189
2635
  </fo:inline>
3190
- </xsl:template><xsl:template match="*[local-name()='localityStack']">
3191
- <xsl:for-each select="*[local-name()='locality']">
3192
- <xsl:if test="position() =1"><xsl:text>, </xsl:text></xsl:if>
3193
- <xsl:apply-templates select="."/>
3194
- <xsl:if test="position() != last()"><xsl:text>; </xsl:text></xsl:if>
3195
- </xsl:for-each>
3196
- </xsl:template><xsl:template match="*[local-name()='link']" name="link">
2636
+ </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3197
2637
  <xsl:variable name="target">
3198
2638
  <xsl:choose>
3199
2639
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -3223,51 +2663,20 @@
3223
2663
  </xsl:otherwise>
3224
2664
  </xsl:choose>
3225
2665
  </fo:inline>
3226
- </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3227
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3228
- <!-- <xsl:choose>
3229
- <xsl:when test="@lang = 'en'"></xsl:when>
3230
- <xsl:otherwise> -->
3231
- <xsl:attribute name="white-space">pre</xsl:attribute>
3232
- <xsl:attribute name="wrap-option">wrap</xsl:attribute>
3233
- <!-- </xsl:otherwise>
3234
- </xsl:choose> -->
3235
- <xsl:apply-templates/>
3236
- </fo:block>
3237
2666
  </xsl:template><xsl:template match="*[local-name()='bookmark']">
3238
2667
  <fo:inline id="{@id}"/>
3239
2668
  </xsl:template><xsl:template match="*[local-name()='appendix']">
3240
2669
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
3241
- <xsl:variable name="title-appendix">
3242
- <xsl:call-template name="getTitle">
3243
- <xsl:with-param name="name" select="'title-appendix'"/>
3244
- </xsl:call-template>
3245
- </xsl:variable>
3246
- <fo:inline padding-right="5mm"><xsl:value-of select="$title-appendix"/> <xsl:number/></fo:inline>
3247
2670
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
3248
2671
  </fo:block>
3249
2672
  <xsl:apply-templates/>
3250
2673
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3251
2674
  <fo:inline><xsl:apply-templates/></fo:inline>
3252
- </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']">
3253
- <fo:block xsl:use-attribute-sets="appendix-example-style">
3254
- <xsl:variable name="claims_id" select="ancestor::*[local-name()='clause'][1]/@id"/>
3255
- <xsl:variable name="title-example">
3256
- <xsl:call-template name="getTitle">
3257
- <xsl:with-param name="name" select="'title-example'"/>
3258
- </xsl:call-template>
3259
- </xsl:variable>
3260
- <xsl:value-of select="$title-example"/>
3261
- <xsl:if test="count(ancestor::*[local-name()='clause'][1]//*[local-name()='example']) &gt; 1">
3262
- <xsl:number count="*[local-name()='example'][ancestor::*[local-name()='clause'][@id = $claims_id]]" level="any"/><xsl:text> </xsl:text>
3263
- </xsl:if>
3264
- <xsl:if test="*[local-name()='name']">
3265
- <xsl:text>— </xsl:text><xsl:apply-templates select="*[local-name()='name']" mode="process"/>
3266
- </xsl:if>
2675
+ </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
2676
+ <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
2677
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3267
2678
  </fo:block>
3268
2679
  <xsl:apply-templates/>
3269
- </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">
3270
- <fo:inline><xsl:apply-templates/></fo:inline>
3271
2680
  </xsl:template><xsl:template match="*[local-name() = 'callout']">
3272
2681
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link>
3273
2682
  </xsl:template><xsl:template match="*[local-name() = 'annotation']">
@@ -3298,76 +2707,892 @@
3298
2707
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3299
2708
  </xsl:choose>
3300
2709
  <xsl:apply-templates/>
3301
- </xsl:template><xsl:template name="convertDate">
3302
- <xsl:param name="date"/>
3303
- <xsl:param name="format" select="'short'"/>
3304
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
3305
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
3306
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
3307
- <xsl:variable name="monthStr">
2710
+ </xsl:template><xsl:template match="*[local-name() = 'xref']">
2711
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2712
+
2713
+ <xsl:apply-templates/>
2714
+ </fo:basic-link>
2715
+ </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2716
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2717
+ <xsl:apply-templates/>
2718
+ </fo:block>
2719
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2720
+ <fo:inline>
2721
+ <xsl:apply-templates/>
2722
+ </fo:inline>
2723
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']/*[local-name() = 'stem']">
2724
+ <fo:inline>
2725
+ <xsl:apply-templates/>
2726
+ </fo:inline>
2727
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
2728
+ <xsl:if test="normalize-space() != ''">
2729
+ <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
2730
+ </xsl:if>
2731
+ </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
2732
+
2733
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
2734
+
2735
+
2736
+
2737
+
2738
+ <fo:block-container margin-left="0mm">
2739
+
2740
+
2741
+
2742
+
2743
+
2744
+
2745
+ <xsl:if test="ancestor::iho:td">
2746
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
2747
+ </xsl:if>
2748
+
2749
+
2750
+
2751
+ <fo:block>
2752
+
2753
+
2754
+
2755
+
2756
+ <fo:inline xsl:use-attribute-sets="note-name-style">
2757
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2758
+ </fo:inline>
2759
+ <xsl:apply-templates/>
2760
+ </fo:block>
2761
+
2762
+
2763
+ </fo:block-container>
2764
+ </fo:block-container>
2765
+
2766
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
2767
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
2768
+ <xsl:choose>
2769
+ <xsl:when test="$num = 1">
2770
+ <fo:inline xsl:use-attribute-sets="note-p-style">
2771
+ <xsl:apply-templates/>
2772
+ </fo:inline>
2773
+ </xsl:when>
2774
+ <xsl:otherwise>
2775
+ <fo:block xsl:use-attribute-sets="note-p-style">
2776
+ <xsl:apply-templates/>
2777
+ </fo:block>
2778
+ </xsl:otherwise>
2779
+ </xsl:choose>
2780
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2781
+ <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2782
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2783
+ <xsl:apply-templates/>
2784
+ </fo:block>
2785
+ </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">
2786
+ <xsl:param name="sfx"/>
2787
+ <xsl:variable name="suffix">
3308
2788
  <xsl:choose>
3309
- <xsl:when test="$month = '01'">January</xsl:when>
3310
- <xsl:when test="$month = '02'">February</xsl:when>
3311
- <xsl:when test="$month = '03'">March</xsl:when>
3312
- <xsl:when test="$month = '04'">April</xsl:when>
3313
- <xsl:when test="$month = '05'">May</xsl:when>
3314
- <xsl:when test="$month = '06'">June</xsl:when>
3315
- <xsl:when test="$month = '07'">July</xsl:when>
3316
- <xsl:when test="$month = '08'">August</xsl:when>
3317
- <xsl:when test="$month = '09'">September</xsl:when>
3318
- <xsl:when test="$month = '10'">October</xsl:when>
3319
- <xsl:when test="$month = '11'">November</xsl:when>
3320
- <xsl:when test="$month = '12'">December</xsl:when>
2789
+ <xsl:when test="$sfx != ''">
2790
+ <xsl:value-of select="$sfx"/>
2791
+ </xsl:when>
2792
+ <xsl:otherwise>
2793
+
2794
+
2795
+ </xsl:otherwise>
3321
2796
  </xsl:choose>
3322
2797
  </xsl:variable>
3323
- <xsl:variable name="result">
2798
+ <xsl:if test="normalize-space() != ''">
2799
+ <xsl:apply-templates/>
2800
+ <xsl:value-of select="$suffix"/>
2801
+ </xsl:if>
2802
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
2803
+ <xsl:param name="sfx"/>
2804
+ <xsl:variable name="suffix">
3324
2805
  <xsl:choose>
3325
- <xsl:when test="$format = 'short' or $day = ''">
3326
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
2806
+ <xsl:when test="$sfx != ''">
2807
+ <xsl:value-of select="$sfx"/>
3327
2808
  </xsl:when>
3328
2809
  <xsl:otherwise>
3329
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
2810
+
2811
+
3330
2812
  </xsl:otherwise>
3331
2813
  </xsl:choose>
3332
2814
  </xsl:variable>
3333
- <xsl:value-of select="$result"/>
3334
- </xsl:template><xsl:template name="insertKeywords">
3335
- <xsl:param name="sorting" select="'true'"/>
3336
- <xsl:param name="charAtEnd" select="'.'"/>
3337
- <xsl:param name="charDelim" select="', '"/>
2815
+ <xsl:if test="normalize-space() != ''">
2816
+ <xsl:apply-templates/>
2817
+ <xsl:value-of select="$suffix"/>
2818
+ </xsl:if>
2819
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
2820
+ <fo:inline><xsl:apply-templates/></fo:inline>
2821
+ </xsl:template><xsl:template match="*[local-name() = 'terms']">
2822
+ <fo:block id="{@id}">
2823
+ <xsl:apply-templates/>
2824
+ </fo:block>
2825
+ </xsl:template><xsl:template match="*[local-name() = 'term']">
2826
+ <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
2827
+
2828
+
2829
+
2830
+ <xsl:apply-templates/>
2831
+ </fo:block>
2832
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
2833
+ <xsl:if test="normalize-space() != ''">
2834
+ <fo:inline>
2835
+ <xsl:apply-templates/>
2836
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
2837
+ <xsl:text>.</xsl:text>
2838
+ </xsl:if> -->
2839
+ </fo:inline>
2840
+ </xsl:if>
2841
+ </xsl:template><xsl:template match="*[local-name() = 'figure']">
2842
+ <fo:block-container id="{@id}">
2843
+ <fo:block>
2844
+ <xsl:apply-templates/>
2845
+ </fo:block>
2846
+ <xsl:call-template name="fn_display_figure"/>
2847
+ <xsl:for-each select="*[local-name() = 'note']">
2848
+ <xsl:call-template name="note"/>
2849
+ </xsl:for-each>
2850
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2851
+ </fo:block-container>
2852
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
2853
+ <fo:block id="{@id}">
2854
+ <xsl:apply-templates/>
2855
+ </fo:block>
2856
+ </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
2857
+ <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
2858
+ <xsl:apply-templates/>
2859
+ </fo:block>
2860
+ </xsl:template><xsl:template match="*[local-name() = 'image']">
2861
+ <fo:block xsl:use-attribute-sets="image-style">
2862
+
2863
+
2864
+ <xsl:variable name="src">
2865
+ <xsl:choose>
2866
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
2867
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
2868
+ </xsl:when>
2869
+ <xsl:otherwise>
2870
+ <xsl:value-of select="@src"/>
2871
+ </xsl:otherwise>
2872
+ </xsl:choose>
2873
+ </xsl:variable>
2874
+
2875
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2876
+ </fo:block>
2877
+ </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">
2878
+ <xsl:apply-templates mode="contents"/>
2879
+ <xsl:text> </xsl:text>
2880
+ </xsl:template><xsl:template match="text()" mode="contents">
2881
+ <xsl:value-of select="."/>
2882
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2883
+ <xsl:if test="normalize-space() != ''">
2884
+ <fo:block xsl:use-attribute-sets="figure-name-style">
2885
+
2886
+ <xsl:apply-templates/>
2887
+ </fo:block>
2888
+ </xsl:if>
2889
+ </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">
2890
+ <xsl:apply-templates mode="contents_item"/>
2891
+ <!-- <xsl:text> </xsl:text> -->
2892
+ </xsl:template><xsl:template name="getSection">
2893
+ <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
2894
+ </xsl:template><xsl:template name="getName">
3338
2895
  <xsl:choose>
3339
- <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
3340
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
3341
- <xsl:sort data-type="text" order="ascending"/>
3342
- <xsl:call-template name="insertKeyword">
3343
- <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
3344
- <xsl:with-param name="charDelim" select="$charDelim"/>
3345
- </xsl:call-template>
3346
- </xsl:for-each>
2896
+ <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
2897
+ <xsl:copy-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/following-sibling::node()"/>
3347
2898
  </xsl:when>
3348
2899
  <xsl:otherwise>
3349
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
3350
- <xsl:call-template name="insertKeyword">
3351
- <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
3352
- <xsl:with-param name="charDelim" select="$charDelim"/>
3353
- </xsl:call-template>
3354
- </xsl:for-each>
2900
+ <xsl:copy-of select="*[local-name() = 'title']/node()"/>
3355
2901
  </xsl:otherwise>
3356
2902
  </xsl:choose>
3357
- </xsl:template><xsl:template name="insertKeyword">
3358
- <xsl:param name="charAtEnd"/>
3359
- <xsl:param name="charDelim"/>
3360
- <xsl:apply-templates/>
2903
+ </xsl:template><xsl:template name="insertTitleAsListItem">
2904
+ <xsl:param name="provisional-distance-between-starts" select="'9.5mm'"/>
2905
+ <xsl:variable name="section">
2906
+ <xsl:for-each select="..">
2907
+ <xsl:call-template name="getSection"/>
2908
+ </xsl:for-each>
2909
+ </xsl:variable>
2910
+ <fo:list-block provisional-distance-between-starts="{$provisional-distance-between-starts}">
2911
+ <fo:list-item>
2912
+ <fo:list-item-label end-indent="label-end()">
2913
+ <fo:block>
2914
+ <xsl:value-of select="$section"/>
2915
+ </fo:block>
2916
+ </fo:list-item-label>
2917
+ <fo:list-item-body start-indent="body-start()">
2918
+ <fo:block>
2919
+ <xsl:choose>
2920
+ <xsl:when test="*[local-name() = 'tab']">
2921
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2922
+ </xsl:when>
2923
+ <xsl:otherwise>
2924
+ <xsl:apply-templates/>
2925
+ </xsl:otherwise>
2926
+ </xsl:choose>
2927
+ </fo:block>
2928
+ </fo:list-item-body>
2929
+ </fo:list-item>
2930
+ </fo:list-block>
2931
+ </xsl:template><xsl:template name="extractTitle">
3361
2932
  <xsl:choose>
3362
- <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
3363
- <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
3364
- </xsl:choose>
3365
- </xsl:template><xsl:template name="addPDFUAmeta">
3366
- <fo:declarations>
3367
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
3368
- <pdf:dictionary type="normal" key="ViewerPreferences">
3369
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
3370
- </pdf:dictionary>
2933
+ <xsl:when test="*[local-name() = 'tab']">
2934
+ <xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
2935
+ </xsl:when>
2936
+ <xsl:otherwise>
2937
+ <xsl:apply-templates/>
2938
+ </xsl:otherwise>
2939
+ </xsl:choose>
2940
+ </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">
2941
+ <xsl:text> </xsl:text>
2942
+ </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2943
+ <xsl:copy>
2944
+ <xsl:apply-templates mode="contents_item"/>
2945
+ </xsl:copy>
2946
+ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2947
+ <xsl:text> </xsl:text>
2948
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2949
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
2950
+ <xsl:apply-templates/>
2951
+ </fo:block>
2952
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2953
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
2954
+ <xsl:variable name="text">
2955
+ <xsl:call-template name="add-zero-spaces-equal"/>
2956
+ </xsl:variable>
2957
+ <xsl:call-template name="add-zero-spaces">
2958
+ <xsl:with-param name="text" select="$text"/>
2959
+ </xsl:call-template>
2960
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2961
+ <xsl:if test="normalize-space() != ''">
2962
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2963
+
2964
+ <xsl:apply-templates/>
2965
+ </fo:block>
2966
+ </xsl:if>
2967
+ </xsl:template><xsl:template match="*[local-name() = 'permission']">
2968
+ <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
2969
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2970
+ <xsl:apply-templates/>
2971
+ </fo:block>
2972
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
2973
+ <xsl:if test="normalize-space() != ''">
2974
+ <fo:block xsl:use-attribute-sets="permission-name-style">
2975
+ <xsl:apply-templates/>
2976
+
2977
+ </fo:block>
2978
+ </xsl:if>
2979
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'label']">
2980
+ <fo:block xsl:use-attribute-sets="permission-label-style">
2981
+ <xsl:apply-templates/>
2982
+ </fo:block>
2983
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']">
2984
+ <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
2985
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2986
+ <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
2987
+ <xsl:apply-templates select="@obligation" mode="presentation"/>
2988
+ <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
2989
+ <xsl:apply-templates/>
2990
+ </fo:block>
2991
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
2992
+ <xsl:if test="normalize-space() != ''">
2993
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
2994
+
2995
+ <xsl:apply-templates/>
2996
+
2997
+ </fo:block>
2998
+ </xsl:if>
2999
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
3000
+ <fo:block xsl:use-attribute-sets="requirement-label-style">
3001
+ <xsl:apply-templates/>
3002
+ </fo:block>
3003
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
3004
+ <fo:block>
3005
+ <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
3006
+ </fo:block>
3007
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
3008
+ <fo:block xsl:use-attribute-sets="requirement-subject-style">
3009
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
3010
+ </fo:block>
3011
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
3012
+ <fo:block xsl:use-attribute-sets="requirement-inherit-style">
3013
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
3014
+ </fo:block>
3015
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
3016
+ <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
3017
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3018
+ <xsl:apply-templates/>
3019
+ </fo:block>
3020
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
3021
+ <xsl:if test="normalize-space() != ''">
3022
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
3023
+ <xsl:apply-templates/>
3024
+
3025
+ </fo:block>
3026
+ </xsl:if>
3027
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'label']">
3028
+ <fo:block xsl:use-attribute-sets="recommendation-label-style">
3029
+ <xsl:apply-templates/>
3030
+ </fo:block>
3031
+ </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3032
+ <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3033
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3034
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3035
+ </xsl:if>
3036
+ <fo:block-container margin-left="0mm" margin-right="0mm">
3037
+ <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3038
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3039
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3040
+ </xsl:if>
3041
+ <xsl:variable name="simple-table">
3042
+ <xsl:call-template name="getSimpleTable"/>
3043
+ </xsl:variable>
3044
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3045
+ <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3046
+ <!-- <fo:table-column column-width="35mm"/>
3047
+ <fo:table-column column-width="115mm"/> -->
3048
+ <fo:table-column column-width="25%"/>
3049
+ <fo:table-column column-width="75%"/>
3050
+ </xsl:if>
3051
+ <xsl:apply-templates mode="requirement"/>
3052
+ </fo:table>
3053
+ <!-- fn processing -->
3054
+ <xsl:if test=".//*[local-name() = 'fn']">
3055
+ <xsl:for-each select="*[local-name() = 'tbody']">
3056
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3057
+ <xsl:call-template name="fn_display"/>
3058
+ </fo:block>
3059
+ </xsl:for-each>
3060
+ </xsl:if>
3061
+ </fo:block-container>
3062
+ </fo:block-container>
3063
+ </xsl:template><xsl:template match="*[local-name()='thead']" mode="requirement">
3064
+ <fo:table-header>
3065
+ <xsl:apply-templates mode="requirement"/>
3066
+ </fo:table-header>
3067
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="requirement">
3068
+ <fo:table-body>
3069
+ <xsl:apply-templates mode="requirement"/>
3070
+ </fo:table-body>
3071
+ </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3072
+ <fo:table-row height="7mm">
3073
+ <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
3074
+ <xsl:attribute name="border">1pt solid black</xsl:attribute>
3075
+ </xsl:if>
3076
+ <xsl:apply-templates mode="requirement"/>
3077
+ </fo:table-row>
3078
+ </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3079
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3080
+ <xsl:attribute name="text-align">
3081
+ <xsl:choose>
3082
+ <xsl:when test="@align">
3083
+ <xsl:value-of select="@align"/>
3084
+ </xsl:when>
3085
+ <xsl:otherwise>left</xsl:otherwise>
3086
+ </xsl:choose>
3087
+ </xsl:attribute>
3088
+ <xsl:if test="@colspan">
3089
+ <xsl:attribute name="number-columns-spanned">
3090
+ <xsl:value-of select="@colspan"/>
3091
+ </xsl:attribute>
3092
+ </xsl:if>
3093
+ <xsl:if test="@rowspan">
3094
+ <xsl:attribute name="number-rows-spanned">
3095
+ <xsl:value-of select="@rowspan"/>
3096
+ </xsl:attribute>
3097
+ </xsl:if>
3098
+
3099
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3100
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3101
+ <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3102
+ </xsl:if>
3103
+ <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3104
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3105
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3106
+ </xsl:if> -->
3107
+
3108
+ <fo:block>
3109
+ <xsl:apply-templates/>
3110
+ </fo:block>
3111
+ </fo:table-cell>
3112
+ </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3113
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3114
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3115
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3116
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3117
+ </xsl:if>
3118
+ <xsl:attribute name="text-align">
3119
+ <xsl:choose>
3120
+ <xsl:when test="@align">
3121
+ <xsl:value-of select="@align"/>
3122
+ </xsl:when>
3123
+ <xsl:otherwise>left</xsl:otherwise>
3124
+ </xsl:choose>
3125
+ </xsl:attribute>
3126
+ <xsl:if test="@colspan">
3127
+ <xsl:attribute name="number-columns-spanned">
3128
+ <xsl:value-of select="@colspan"/>
3129
+ </xsl:attribute>
3130
+ </xsl:if>
3131
+ <xsl:if test="@rowspan">
3132
+ <xsl:attribute name="number-rows-spanned">
3133
+ <xsl:value-of select="@rowspan"/>
3134
+ </xsl:attribute>
3135
+ </xsl:if>
3136
+
3137
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3138
+ <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3139
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3140
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3141
+ <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3142
+ </xsl:if>
3143
+ </xsl:if> -->
3144
+ <!-- 2nd line and below -->
3145
+
3146
+ <fo:block>
3147
+ <xsl:apply-templates/>
3148
+ </fo:block>
3149
+ </fo:table-cell>
3150
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3151
+ <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3152
+ <xsl:apply-templates/>
3153
+ </fo:block>
3154
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3155
+ <fo:block> <!-- margin-bottom="10pt" -->
3156
+ <xsl:apply-templates/>
3157
+ </fo:block>
3158
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']">
3159
+ <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
3160
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3161
+ <xsl:apply-templates/>
3162
+ </fo:block>
3163
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
3164
+ <xsl:if test="normalize-space() != ''">
3165
+ <fo:inline xsl:use-attribute-sets="termexample-name-style">
3166
+ <xsl:apply-templates/>
3167
+ </fo:inline>
3168
+ </xsl:if>
3169
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
3170
+ <fo:inline><xsl:apply-templates/></fo:inline>
3171
+ </xsl:template><xsl:template match="*[local-name() = 'example']">
3172
+ <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
3173
+
3174
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3175
+
3176
+ <xsl:variable name="element">
3177
+ block
3178
+
3179
+ </xsl:variable>
3180
+
3181
+ <xsl:choose>
3182
+ <xsl:when test="normalize-space($element) = 'block'">
3183
+ <fo:block xsl:use-attribute-sets="example-body-style">
3184
+ <xsl:apply-templates/>
3185
+ </fo:block>
3186
+ </xsl:when>
3187
+ <xsl:otherwise>
3188
+ <fo:inline>
3189
+ <xsl:apply-templates/>
3190
+ </fo:inline>
3191
+ </xsl:otherwise>
3192
+ </xsl:choose>
3193
+
3194
+ </fo:block>
3195
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'example']/*[local-name() = 'name']" mode="presentation">
3196
+
3197
+ <xsl:variable name="element">
3198
+ block
3199
+
3200
+ </xsl:variable>
3201
+ <xsl:choose>
3202
+ <xsl:when test="ancestor::*[local-name() = 'appendix']">
3203
+ <fo:inline>
3204
+ <xsl:apply-templates/>
3205
+ </fo:inline>
3206
+ </xsl:when>
3207
+ <xsl:when test="normalize-space($element) = 'block'">
3208
+ <fo:block xsl:use-attribute-sets="example-name-style">
3209
+ <xsl:apply-templates/>
3210
+ </fo:block>
3211
+ </xsl:when>
3212
+ <xsl:otherwise>
3213
+ <fo:inline xsl:use-attribute-sets="example-name-style">
3214
+ <xsl:apply-templates/>
3215
+ </fo:inline>
3216
+ </xsl:otherwise>
3217
+ </xsl:choose>
3218
+
3219
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3220
+ <fo:block xsl:use-attribute-sets="example-p-style">
3221
+
3222
+ <xsl:apply-templates/>
3223
+ </fo:block>
3224
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3225
+ <fo:block xsl:use-attribute-sets="termsource-style">
3226
+ <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3227
+ <xsl:variable name="termsource_text">
3228
+ <xsl:apply-templates/>
3229
+ </xsl:variable>
3230
+ <xsl:choose>
3231
+ <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3232
+ <xsl:apply-templates/>
3233
+ </xsl:when>
3234
+ <xsl:otherwise>
3235
+ <xsl:text>[</xsl:text>
3236
+ <xsl:apply-templates/>
3237
+ <xsl:text>]</xsl:text>
3238
+ </xsl:otherwise>
3239
+ </xsl:choose>
3240
+ </fo:block>
3241
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
3242
+ <xsl:if test="normalize-space() != ''">
3243
+ <xsl:value-of select="."/>
3244
+ </xsl:if>
3245
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
3246
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3247
+
3248
+ <xsl:call-template name="getTitle">
3249
+ <xsl:with-param name="name" select="'title-source'"/>
3250
+ </xsl:call-template>
3251
+ <xsl:text>: </xsl:text>
3252
+
3253
+ <fo:inline xsl:use-attribute-sets="origin-style">
3254
+ <xsl:apply-templates/>
3255
+ </fo:inline>
3256
+ </fo:basic-link>
3257
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
3258
+ <fo:inline><xsl:apply-templates/></fo:inline>
3259
+ </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
3260
+ <xsl:if test="normalize-space() != ''">
3261
+ <xsl:value-of select="."/>
3262
+ </xsl:if>
3263
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3264
+
3265
+ <fo:block xsl:use-attribute-sets="quote-style">
3266
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3267
+ </fo:block>
3268
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3269
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3270
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3271
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3272
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3273
+ </fo:block>
3274
+ </xsl:if>
3275
+ </xsl:template><xsl:template match="*[local-name() = 'source']">
3276
+ <xsl:if test="../*[local-name() = 'author']">
3277
+ <xsl:text>, </xsl:text>
3278
+ </xsl:if>
3279
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3280
+ <xsl:apply-templates/>
3281
+ </fo:basic-link>
3282
+ </xsl:template><xsl:template match="*[local-name() = 'author']">
3283
+ <xsl:text>— </xsl:text>
3284
+ <xsl:apply-templates/>
3285
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
3286
+ <fo:inline xsl:use-attribute-sets="eref-style">
3287
+ <xsl:if test="@type = 'footnote'">
3288
+
3289
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
3290
+ <xsl:attribute name="font-size">80%</xsl:attribute>
3291
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
3292
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
3293
+
3294
+
3295
+ </xsl:if>
3296
+
3297
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3298
+
3299
+ <xsl:if test="@type = 'inline'">
3300
+
3301
+ <xsl:attribute name="color">blue</xsl:attribute>
3302
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
3303
+
3304
+
3305
+ </xsl:if>
3306
+
3307
+
3308
+ <xsl:apply-templates/>
3309
+ </fo:basic-link>
3310
+ </fo:inline>
3311
+ </xsl:template><xsl:template match="*[local-name() = 'tab']">
3312
+ <!-- zero-space char -->
3313
+ <xsl:variable name="depth">
3314
+ <xsl:call-template name="getLevel">
3315
+ <xsl:with-param name="depth" select="../@depth"/>
3316
+ </xsl:call-template>
3317
+ </xsl:variable>
3318
+
3319
+ <xsl:variable name="padding">
3320
+
3321
+
3322
+
3323
+
3324
+
3325
+ <xsl:choose>
3326
+ <xsl:when test="$depth = 2">3</xsl:when>
3327
+ <xsl:when test="$depth = 3">3</xsl:when>
3328
+ <xsl:otherwise>4</xsl:otherwise>
3329
+ </xsl:choose>
3330
+
3331
+
3332
+
3333
+
3334
+
3335
+
3336
+
3337
+
3338
+
3339
+
3340
+
3341
+
3342
+
3343
+ </xsl:variable>
3344
+
3345
+ <xsl:variable name="padding-right">
3346
+ <xsl:choose>
3347
+ <xsl:when test="normalize-space($padding) = ''">0</xsl:when>
3348
+ <xsl:otherwise>
3349
+ <xsl:value-of select="normalize-space($padding)"/>
3350
+ </xsl:otherwise>
3351
+ </xsl:choose>
3352
+ </xsl:variable>
3353
+
3354
+ <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3355
+
3356
+ <xsl:choose>
3357
+ <xsl:when test="$language = 'zh'">
3358
+ <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
3359
+ </xsl:when>
3360
+ <xsl:when test="../../@inline-header = 'true'">
3361
+ <fo:inline font-size="90%">
3362
+ <xsl:call-template name="insertNonBreakSpaces">
3363
+ <xsl:with-param name="count" select="$padding-right"/>
3364
+ </xsl:call-template>
3365
+ </fo:inline>
3366
+ </xsl:when>
3367
+ <xsl:otherwise>
3368
+ <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
3369
+ </xsl:otherwise>
3370
+ </xsl:choose>
3371
+
3372
+ </xsl:template><xsl:template name="insertNonBreakSpaces">
3373
+ <xsl:param name="count"/>
3374
+ <xsl:if test="$count &gt; 0">
3375
+ <xsl:text> </xsl:text>
3376
+ <xsl:call-template name="insertNonBreakSpaces">
3377
+ <xsl:with-param name="count" select="$count - 1"/>
3378
+ </xsl:call-template>
3379
+ </xsl:if>
3380
+ </xsl:template><xsl:template match="*[local-name() = 'domain']">
3381
+ <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
3382
+ <xsl:text> </xsl:text>
3383
+ </xsl:template><xsl:template match="*[local-name() = 'admitted']">
3384
+ <fo:block xsl:use-attribute-sets="admitted-style">
3385
+ <xsl:apply-templates/>
3386
+ </fo:block>
3387
+ </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3388
+ <xsl:variable name="title-deprecated">
3389
+ <xsl:call-template name="getTitle">
3390
+ <xsl:with-param name="name" select="'title-deprecated'"/>
3391
+ </xsl:call-template>
3392
+ </xsl:variable>
3393
+ <fo:block xsl:use-attribute-sets="deprecates-style">
3394
+ <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
3395
+ </fo:block>
3396
+ </xsl:template><xsl:template match="*[local-name() = 'definition']">
3397
+ <fo:block xsl:use-attribute-sets="definition-style">
3398
+ <xsl:apply-templates/>
3399
+ </fo:block>
3400
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
3401
+ <xsl:apply-templates/>
3402
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
3403
+ <fo:inline> <xsl:apply-templates/></fo:inline>
3404
+ <fo:block> </fo:block>
3405
+ </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
3406
+
3407
+ <fo:block>
3408
+ <xsl:call-template name="setId"/>
3409
+
3410
+
3411
+
3412
+
3413
+
3414
+
3415
+
3416
+
3417
+
3418
+
3419
+ <xsl:apply-templates/>
3420
+ </fo:block>
3421
+
3422
+
3423
+
3424
+ </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
3425
+ <fo:block break-after="page"/>
3426
+ <fo:block>
3427
+ <xsl:call-template name="setId"/>
3428
+ <xsl:apply-templates/>
3429
+ </fo:block>
3430
+ </xsl:template><xsl:template match="*[local-name() = 'clause']">
3431
+ <fo:block>
3432
+ <xsl:call-template name="setId"/>
3433
+ <xsl:apply-templates/>
3434
+ </fo:block>
3435
+ </xsl:template><xsl:template match="*[local-name() = 'definitions']">
3436
+ <fo:block id="{@id}">
3437
+ <xsl:apply-templates/>
3438
+ </fo:block>
3439
+ </xsl:template><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
3440
+
3441
+ <fo:block id="{@id}">
3442
+ <xsl:apply-templates/>
3443
+ </fo:block>
3444
+ </xsl:template><xsl:template match="*[local-name() = 'annex']">
3445
+ <fo:block break-after="page"/>
3446
+ <fo:block id="{@id}">
3447
+
3448
+ </fo:block>
3449
+ <xsl:apply-templates/>
3450
+ </xsl:template><xsl:template match="*[local-name() = 'review']">
3451
+ <!-- comment 2019-11-29 -->
3452
+ <!-- <fo:block font-weight="bold">Review:</fo:block>
3453
+ <xsl:apply-templates /> -->
3454
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3455
+ <!-- 0xA0 to space replacement -->
3456
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3457
+ </xsl:template><xsl:template match="*[local-name() = 'errata']">
3458
+ <!-- <row>
3459
+ <date>05-07-2013</date>
3460
+ <type>Editorial</type>
3461
+ <change>Changed CA-9 Priority Code from P1 to P2 in <xref target="tabled2"/>.</change>
3462
+ <pages>D-3</pages>
3463
+ </row>
3464
+ -->
3465
+ <fo:table table-layout="fixed" width="100%" font-size="10pt" border="1pt solid black">
3466
+ <fo:table-column column-width="20mm"/>
3467
+ <fo:table-column column-width="23mm"/>
3468
+ <fo:table-column column-width="107mm"/>
3469
+ <fo:table-column column-width="15mm"/>
3470
+ <fo:table-body>
3471
+ <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
3472
+ <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
3473
+ <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
3474
+ <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
3475
+ <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
3476
+ </fo:table-row>
3477
+ <xsl:apply-templates/>
3478
+ </fo:table-body>
3479
+ </fo:table>
3480
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']">
3481
+ <fo:table-row>
3482
+ <xsl:apply-templates/>
3483
+ </fo:table-row>
3484
+ </xsl:template><xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
3485
+ <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3486
+ <fo:block><xsl:apply-templates/></fo:block>
3487
+ </fo:table-cell>
3488
+ </xsl:template><xsl:template name="processBibitem">
3489
+
3490
+ </xsl:template><xsl:template name="processPersonalAuthor">
3491
+ <xsl:choose>
3492
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3493
+ <author>
3494
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3495
+ </author>
3496
+ </xsl:when>
3497
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3498
+ <author>
3499
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3500
+ <xsl:text> </xsl:text>
3501
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3502
+ </author>
3503
+ </xsl:when>
3504
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3505
+ <author>
3506
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3507
+ <xsl:text> </xsl:text>
3508
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3509
+ </author>
3510
+ </xsl:when>
3511
+ <xsl:otherwise>
3512
+ <xsl:apply-templates/>
3513
+ </xsl:otherwise>
3514
+ </xsl:choose>
3515
+ </xsl:template><xsl:template name="renderDate">
3516
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3517
+ <xsl:value-of select="*[local-name() = 'on']"/>
3518
+ </xsl:if>
3519
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3520
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3521
+ </xsl:if>
3522
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3523
+ <xsl:value-of select="translate(.,'. ','')"/>
3524
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3525
+ <xsl:value-of select="substring(.,1,1)"/>
3526
+ </xsl:template><xsl:template name="convertDate">
3527
+ <xsl:param name="date"/>
3528
+ <xsl:param name="format" select="'short'"/>
3529
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
3530
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
3531
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
3532
+ <xsl:variable name="monthStr">
3533
+ <xsl:choose>
3534
+ <xsl:when test="$month = '01'">January</xsl:when>
3535
+ <xsl:when test="$month = '02'">February</xsl:when>
3536
+ <xsl:when test="$month = '03'">March</xsl:when>
3537
+ <xsl:when test="$month = '04'">April</xsl:when>
3538
+ <xsl:when test="$month = '05'">May</xsl:when>
3539
+ <xsl:when test="$month = '06'">June</xsl:when>
3540
+ <xsl:when test="$month = '07'">July</xsl:when>
3541
+ <xsl:when test="$month = '08'">August</xsl:when>
3542
+ <xsl:when test="$month = '09'">September</xsl:when>
3543
+ <xsl:when test="$month = '10'">October</xsl:when>
3544
+ <xsl:when test="$month = '11'">November</xsl:when>
3545
+ <xsl:when test="$month = '12'">December</xsl:when>
3546
+ </xsl:choose>
3547
+ </xsl:variable>
3548
+ <xsl:variable name="result">
3549
+ <xsl:choose>
3550
+ <xsl:when test="$format = 'short' or $day = ''">
3551
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
3552
+ </xsl:when>
3553
+ <xsl:otherwise>
3554
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
3555
+ </xsl:otherwise>
3556
+ </xsl:choose>
3557
+ </xsl:variable>
3558
+ <xsl:value-of select="$result"/>
3559
+ </xsl:template><xsl:template name="insertKeywords">
3560
+ <xsl:param name="sorting" select="'true'"/>
3561
+ <xsl:param name="charAtEnd" select="'.'"/>
3562
+ <xsl:param name="charDelim" select="', '"/>
3563
+ <xsl:choose>
3564
+ <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
3565
+ <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
3566
+ <xsl:sort data-type="text" order="ascending"/>
3567
+ <xsl:call-template name="insertKeyword">
3568
+ <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
3569
+ <xsl:with-param name="charDelim" select="$charDelim"/>
3570
+ </xsl:call-template>
3571
+ </xsl:for-each>
3572
+ </xsl:when>
3573
+ <xsl:otherwise>
3574
+ <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
3575
+ <xsl:call-template name="insertKeyword">
3576
+ <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
3577
+ <xsl:with-param name="charDelim" select="$charDelim"/>
3578
+ </xsl:call-template>
3579
+ </xsl:for-each>
3580
+ </xsl:otherwise>
3581
+ </xsl:choose>
3582
+ </xsl:template><xsl:template name="insertKeyword">
3583
+ <xsl:param name="charAtEnd"/>
3584
+ <xsl:param name="charDelim"/>
3585
+ <xsl:apply-templates/>
3586
+ <xsl:choose>
3587
+ <xsl:when test="position() != last()"><xsl:value-of select="$charDelim"/></xsl:when>
3588
+ <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
3589
+ </xsl:choose>
3590
+ </xsl:template><xsl:template name="addPDFUAmeta">
3591
+ <fo:declarations>
3592
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
3593
+ <pdf:dictionary type="normal" key="ViewerPreferences">
3594
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
3595
+ </pdf:dictionary>
3371
3596
  </pdf:catalog>
3372
3597
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
3373
3598
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
@@ -3430,27 +3655,49 @@
3430
3655
  </xsl:otherwise>
3431
3656
  </xsl:choose>
3432
3657
  </xsl:template><xsl:template name="getLevel">
3433
- <xsl:variable name="level_total" select="count(ancestor::*)"/>
3434
- <xsl:variable name="level">
3435
- <xsl:choose>
3436
- <xsl:when test="ancestor::*[local-name() = 'preface']">
3437
- <xsl:value-of select="$level_total - 2"/>
3438
- </xsl:when>
3439
- <xsl:when test="ancestor::*[local-name() = 'sections']">
3440
- <xsl:value-of select="$level_total - 2"/>
3441
- </xsl:when>
3442
- <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3443
- <xsl:value-of select="$level_total - 2"/>
3444
- </xsl:when>
3445
- <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3446
- <xsl:otherwise>
3447
- <xsl:value-of select="$level_total - 1"/>
3448
- </xsl:otherwise>
3449
- </xsl:choose>
3450
- </xsl:variable>
3451
- <xsl:value-of select="$level"/>
3452
- </xsl:template><xsl:template name="getSubSection">
3453
- <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']"/>
3658
+ <xsl:param name="depth"/>
3659
+ <xsl:choose>
3660
+ <xsl:when test="normalize-space(@depth) != ''">
3661
+ <xsl:value-of select="@depth"/>
3662
+ </xsl:when>
3663
+ <xsl:when test="normalize-space($depth) != ''">
3664
+ <xsl:value-of select="$depth"/>
3665
+ </xsl:when>
3666
+ <xsl:otherwise>
3667
+ <xsl:variable name="level_total" select="count(ancestor::*)"/>
3668
+ <xsl:variable name="level">
3669
+ <xsl:choose>
3670
+ <xsl:when test="parent::*[local-name() = 'preface']">
3671
+ <xsl:value-of select="$level_total - 1"/>
3672
+ </xsl:when>
3673
+ <xsl:when test="ancestor::*[local-name() = 'preface']">
3674
+ <xsl:value-of select="$level_total - 2"/>
3675
+ </xsl:when>
3676
+ <!-- <xsl:when test="parent::*[local-name() = 'sections']">
3677
+ <xsl:value-of select="$level_total - 1"/>
3678
+ </xsl:when> -->
3679
+ <xsl:when test="ancestor::*[local-name() = 'sections']">
3680
+ <xsl:value-of select="$level_total - 1"/>
3681
+ </xsl:when>
3682
+ <xsl:when test="ancestor::*[local-name() = 'bibliography']">
3683
+ <xsl:value-of select="$level_total - 1"/>
3684
+ </xsl:when>
3685
+ <xsl:when test="parent::*[local-name() = 'annex']">
3686
+ <xsl:value-of select="$level_total - 1"/>
3687
+ </xsl:when>
3688
+ <xsl:when test="ancestor::*[local-name() = 'annex']">
3689
+ <xsl:value-of select="$level_total"/>
3690
+ </xsl:when>
3691
+ <xsl:when test="local-name() = 'annex'">1</xsl:when>
3692
+ <xsl:when test="local-name(ancestor::*[1]) = 'annex'">1</xsl:when>
3693
+ <xsl:otherwise>
3694
+ <xsl:value-of select="$level_total - 1"/>
3695
+ </xsl:otherwise>
3696
+ </xsl:choose>
3697
+ </xsl:variable>
3698
+ <xsl:value-of select="$level"/>
3699
+ </xsl:otherwise>
3700
+ </xsl:choose>
3454
3701
  </xsl:template><xsl:template name="split">
3455
3702
  <xsl:param name="pText" select="."/>
3456
3703
  <xsl:param name="sep" select="','"/>
@@ -3465,4 +3712,47 @@
3465
3712
  </xsl:if>
3466
3713
  </xsl:template><xsl:template name="getDocumentId">
3467
3714
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
3715
+ </xsl:template><xsl:template name="namespaceCheck">
3716
+ <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
3717
+ <xsl:variable name="XSLNS">
3718
+
3719
+
3720
+
3721
+
3722
+
3723
+
3724
+
3725
+
3726
+
3727
+
3728
+
3729
+ <xsl:value-of select="document('')//*/namespace::iho"/>
3730
+
3731
+
3732
+
3733
+ </xsl:variable>
3734
+ <xsl:if test="$documentNS != $XSLNS">
3735
+ <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
3736
+ </xsl:if>
3737
+ </xsl:template><xsl:template name="getLanguage">
3738
+ <xsl:param name="lang"/>
3739
+ <xsl:variable name="language" select="java:toLowerCase(java:java.lang.String.new($lang))"/>
3740
+ <xsl:choose>
3741
+ <xsl:when test="$language = 'en'">English</xsl:when>
3742
+ <xsl:when test="$language = 'fr'">French</xsl:when>
3743
+ <xsl:when test="$language = 'de'">Deutsch</xsl:when>
3744
+ <xsl:when test="$language = 'cn'">Chinese</xsl:when>
3745
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
3746
+ </xsl:choose>
3747
+ </xsl:template><xsl:template name="setId">
3748
+ <xsl:attribute name="id">
3749
+ <xsl:choose>
3750
+ <xsl:when test="@id">
3751
+ <xsl:value-of select="@id"/>
3752
+ </xsl:when>
3753
+ <xsl:otherwise>
3754
+ <xsl:value-of select="generate-id()"/>
3755
+ </xsl:otherwise>
3756
+ </xsl:choose>
3757
+ </xsl:attribute>
3468
3758
  </xsl:template></xsl:stylesheet>