metanorma-mpfa 0.6.10 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,6 +58,14 @@
58
58
  <optional>
59
59
  <attribute name="type"/>
60
60
  </optional>
61
+ <optional>
62
+ <attribute name="tag"/>
63
+ </optional>
64
+ <optional>
65
+ <attribute name="multilingual-rendering">
66
+ <ref name="MultilingualRenderingType"/>
67
+ </attribute>
68
+ </optional>
61
69
  <optional>
62
70
  <ref name="reqtitle"/>
63
71
  </optional>
@@ -101,7 +109,9 @@
101
109
  </define>
102
110
  <define name="label">
103
111
  <element name="label">
104
- <text/>
112
+ <oneOrMore>
113
+ <ref name="TextElement"/>
114
+ </oneOrMore>
105
115
  </element>
106
116
  </define>
107
117
  <define name="subject">
@@ -175,8 +185,19 @@
175
185
  <data type="boolean"/>
176
186
  </attribute>
177
187
  </optional>
188
+ <optional>
189
+ <attribute name="tag"/>
190
+ </optional>
191
+ <optional>
192
+ <attribute name="multilingual-rendering">
193
+ <ref name="MultilingualRenderingType"/>
194
+ </attribute>
195
+ </optional>
178
196
  <oneOrMore>
179
- <ref name="BasicBlock"/>
197
+ <choice>
198
+ <ref name="BasicBlock"/>
199
+ <ref name="component"/>
200
+ </choice>
180
201
  </oneOrMore>
181
202
  </define>
182
203
  <define name="ObligationType">
@@ -6,16 +6,14 @@ module Asciidoctor
6
6
  #
7
7
  class Converter < Standoc::Converter
8
8
 
9
- def sections_cleanup(x)
9
+ def sections_cleanup(xml)
10
10
  super
11
- x.xpath("//*[@inline-header]").each do |h|
11
+ xml.xpath("//*[@inline-header]").each do |h|
12
12
  h.delete("inline-header")
13
13
  end
14
- x.xpath("//*[@guidance]").each do |h|
15
- #c = h.at("./preceding-sibling::clause[last()]") || next
14
+ xml.xpath("//*[@guidance]").each do |h|
16
15
  c = h.xpath("./preceding-sibling::clause")
17
16
  c.empty? and next
18
- #c.add_child h.remove
19
17
  c.last.add_child h.remove
20
18
  end
21
19
  end
@@ -29,7 +27,7 @@ module Asciidoctor
29
27
  end
30
28
 
31
29
  def term_def_title(_toplevel, node)
32
- return node.title
30
+ node.title
33
31
  end
34
32
 
35
33
  def move_sections_into_preface(x, preface)
@@ -661,6 +661,12 @@ ul > li p:first-child {
661
661
  ul > li:first-child {
662
662
  margin-top: 1em; }
663
663
 
664
+ ul ul > li:first-child {
665
+ margin-top: 0; }
666
+
667
+ ol ul > li:first-child {
668
+ margin-top: 0; }
669
+
664
670
  #toc-list ul {
665
671
  margin-bottom: 0.25em; }
666
672
 
@@ -325,6 +325,14 @@ ul > li:first-child {
325
325
  margin-top: 1em;
326
326
  }
327
327
 
328
+ ul ul > li:first-child {
329
+ margin-top: 0;
330
+ }
331
+ ol ul > li:first-child {
332
+ margin-top: 0;
333
+ }
334
+
335
+
328
336
  #toc-list ul {margin-bottom: 0.25em;}
329
337
 
330
338
  #toc-list li {list-style-type: none;}
@@ -153,6 +153,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
153
153
  p.MsoCommentText, li.MsoCommentText, div.MsoCommentText {
154
154
  mso-style-noshow: yes;
155
155
  mso-style-unhide: no;
156
+ mso-style-name: "Comment Text";
156
157
  margin: 0cm;
157
158
  margin-bottom: .0001pt;
158
159
  mso-pagination: widow-orphan;
@@ -373,6 +374,7 @@ h1 {
373
374
  mso-style-priority: 1;
374
375
  mso-style-unhide: no;
375
376
  mso-style-qformat: yes;
377
+ mso-style-name: "Heading 1";
376
378
  mso-style-link: "Heading 1 Char";
377
379
  mso-style-next: Normal;
378
380
  margin-top: 13.5pt;
@@ -459,6 +461,7 @@ h2 {
459
461
  mso-style-priority: 2;
460
462
  mso-style-unhide: no;
461
463
  mso-style-qformat: yes;
464
+ mso-style-name: "Heading 2";
462
465
  mso-style-parent: "Heading 1";
463
466
  mso-style-link: "Heading 2 Char";
464
467
  mso-style-next: Normal;
@@ -487,7 +490,8 @@ h3 {
487
490
  mso-style-priority: 3;
488
491
  mso-style-unhide: no;
489
492
  mso-style-qformat: yes;
490
- mso-style-parent: "Heading 1";
493
+ mso-style-name: "Heading 3";
494
+ mso-style-parent: "Heading 2";
491
495
  mso-style-link: "Heading 3 Char";
492
496
  mso-style-next: Normal;
493
497
  margin-top: 3.0pt;
@@ -514,6 +518,7 @@ h4 {
514
518
  mso-style-priority: 4;
515
519
  mso-style-unhide: no;
516
520
  mso-style-qformat: yes;
521
+ mso-style-name: "Heading 4";
517
522
  mso-style-parent: "Heading 3";
518
523
  mso-style-link: "Heading 4 Char";
519
524
  mso-style-next: Normal;
@@ -541,6 +546,7 @@ h5 {
541
546
  mso-style-priority: 5;
542
547
  mso-style-unhide: no;
543
548
  mso-style-qformat: yes;
549
+ mso-style-name: "Heading 5";
544
550
  mso-style-parent: "Heading 4";
545
551
  mso-style-link: "Heading 5 Char";
546
552
  mso-style-next: Normal;
@@ -568,6 +574,7 @@ h6 {
568
574
  mso-style-priority: 6;
569
575
  mso-style-unhide: no;
570
576
  mso-style-qformat: yes;
577
+ mso-style-name: "Heading 6";
571
578
  mso-style-parent: "Heading 5";
572
579
  mso-style-link: "Heading 6 Char";
573
580
  mso-style-next: Normal;
@@ -594,6 +601,7 @@ h6 {
594
601
  p.MsoToc1, li.MsoToc1, div.MsoToc1 {
595
602
  mso-style-priority: 39;
596
603
  mso-style-unhide: no;
604
+ mso-style-name: "TOC 1";
597
605
  mso-style-next: Normal;
598
606
  margin-top: 6.0pt;
599
607
  margin-right: 25.0pt;
@@ -617,6 +625,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2 {
617
625
  mso-style-noshow: yes;
618
626
  mso-style-priority: 39;
619
627
  mso-style-unhide: no;
628
+ mso-style-name: "TOC 2";
620
629
  mso-style-parent: "TOC 1";
621
630
  mso-style-next: Normal;
622
631
  margin-top: 0cm;
@@ -641,6 +650,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3 {
641
650
  mso-style-noshow: yes;
642
651
  mso-style-priority: 39;
643
652
  mso-style-unhide: no;
653
+ mso-style-name: "TOC 3";
644
654
  mso-style-parent: "TOC 2";
645
655
  mso-style-next: Normal;
646
656
  margin-top: 0cm;
@@ -663,6 +673,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3 {
663
673
 
664
674
  span.MsoFootnoteReference {
665
675
  mso-style-priority: 99;
676
+ mso-style-name: "Footnote Reference";
666
677
  vertical-align: super; }
667
678
 
668
679
  p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText {
@@ -139,6 +139,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
139
139
  p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
140
140
  {mso-style-noshow:yes;
141
141
  mso-style-unhide:no;
142
+ mso-style-name:"Comment Text";
142
143
  margin:0cm;
143
144
  margin-bottom:.0001pt;
144
145
  mso-pagination:widow-orphan;
@@ -343,6 +344,7 @@ h1
343
344
  {mso-style-priority:1;
344
345
  mso-style-unhide:no;
345
346
  mso-style-qformat:yes;
347
+ mso-style-name:"Heading 1";
346
348
  mso-style-link:"Heading 1 Char";
347
349
  mso-style-next:Normal;
348
350
  margin-top:13.5pt;
@@ -426,6 +428,7 @@ h2
426
428
  {mso-style-priority:2;
427
429
  mso-style-unhide:no;
428
430
  mso-style-qformat:yes;
431
+ mso-style-name:"Heading 2";
429
432
  mso-style-parent:"Heading 1";
430
433
  mso-style-link:"Heading 2 Char";
431
434
  mso-style-next:Normal;
@@ -453,7 +456,8 @@ h3
453
456
  {mso-style-priority:3;
454
457
  mso-style-unhide:no;
455
458
  mso-style-qformat:yes;
456
- mso-style-parent:"Heading 1";
459
+ mso-style-name:"Heading 3";
460
+ mso-style-parent:"Heading 2";
457
461
  mso-style-link:"Heading 3 Char";
458
462
  mso-style-next:Normal;
459
463
  margin-top:3.0pt;
@@ -479,6 +483,7 @@ h4
479
483
  {mso-style-priority:4;
480
484
  mso-style-unhide:no;
481
485
  mso-style-qformat:yes;
486
+ mso-style-name:"Heading 4";
482
487
  mso-style-parent:"Heading 3";
483
488
  mso-style-link:"Heading 4 Char";
484
489
  mso-style-next:Normal;
@@ -505,6 +510,7 @@ h5
505
510
  {mso-style-priority:5;
506
511
  mso-style-unhide:no;
507
512
  mso-style-qformat:yes;
513
+ mso-style-name:"Heading 5";
508
514
  mso-style-parent:"Heading 4";
509
515
  mso-style-link:"Heading 5 Char";
510
516
  mso-style-next:Normal;
@@ -531,6 +537,7 @@ h6
531
537
  {mso-style-priority:6;
532
538
  mso-style-unhide:no;
533
539
  mso-style-qformat:yes;
540
+ mso-style-name:"Heading 6";
534
541
  mso-style-parent:"Heading 5";
535
542
  mso-style-link:"Heading 6 Char";
536
543
  mso-style-next:Normal;
@@ -556,6 +563,7 @@ h6
556
563
  p.MsoToc1, li.MsoToc1, div.MsoToc1
557
564
  {mso-style-priority:39;
558
565
  mso-style-unhide:no;
566
+ mso-style-name:"TOC 1";
559
567
  mso-style-next:Normal;
560
568
  margin-top:6.0pt;
561
569
  margin-right:25.0pt;
@@ -578,6 +586,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2
578
586
  {mso-style-noshow:yes;
579
587
  mso-style-priority:39;
580
588
  mso-style-unhide:no;
589
+ mso-style-name:"TOC 2";
581
590
  mso-style-parent:"TOC 1";
582
591
  mso-style-next:Normal;
583
592
  margin-top:0cm;
@@ -601,6 +610,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
601
610
  {mso-style-noshow:yes;
602
611
  mso-style-priority:39;
603
612
  mso-style-unhide:no;
613
+ mso-style-name:"TOC 3";
604
614
  mso-style-parent:"TOC 2";
605
615
  mso-style-next:Normal;
606
616
  margin-top:0cm;
@@ -622,6 +632,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
622
632
  mso-bidi-font-weight:normal;}
623
633
  span.MsoFootnoteReference
624
634
  {mso-style-priority:99;
635
+ mso-style-name:"Footnote Reference";
625
636
  vertical-align:super;}
626
637
  p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
627
638
  {mso-style-noshow:yes;
@@ -881,6 +881,8 @@
881
881
 
882
882
  <title-list-figures lang="en">List of Figures</title-list-figures>
883
883
 
884
+ <title-table-figures lang="en">Table of Figures</title-table-figures>
885
+
884
886
  <title-list-recommendations lang="en">List of Recommendations</title-list-recommendations>
885
887
 
886
888
  <title-acknowledgements lang="en">Acknowledgements</title-acknowledgements>
@@ -1152,6 +1154,11 @@
1152
1154
 
1153
1155
 
1154
1156
 
1157
+ </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1158
+
1159
+
1160
+
1161
+
1155
1162
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1156
1163
 
1157
1164
 
@@ -1307,13 +1314,20 @@
1307
1314
 
1308
1315
  </xsl:attribute-set><xsl:attribute-set name="list-style">
1309
1316
 
1310
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1317
+ </xsl:attribute-set><xsl:attribute-set name="toc-style">
1318
+ <xsl:attribute name="line-height">135%</xsl:attribute>
1319
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1311
1320
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1312
1321
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1313
1322
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1314
1323
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1315
1324
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1316
- </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1325
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1326
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1327
+ <xsl:sort select="@displayorder" data-type="number"/>
1328
+ <xsl:apply-templates select="." mode="contents"/>
1329
+ </xsl:for-each>
1330
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1317
1331
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1318
1332
 
1319
1333
  <!-- Normative references -->
@@ -1326,13 +1340,33 @@
1326
1340
  <!-- Bibliography -->
1327
1341
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1328
1342
 
1329
- </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1343
+ </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1344
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1345
+ <xsl:sort select="@displayorder" data-type="number"/>
1346
+ <xsl:apply-templates select="." mode="contents"/>
1347
+ </xsl:for-each>
1348
+
1349
+ <xsl:for-each select="/*/*[local-name()='annex']">
1350
+ <xsl:sort select="@displayorder" data-type="number"/>
1351
+ <xsl:apply-templates select="." mode="contents"/>
1352
+ </xsl:for-each>
1353
+
1354
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1355
+ <xsl:sort select="@displayorder" data-type="number"/>
1356
+ <xsl:apply-templates select="." mode="contents"/>
1357
+ </xsl:for-each>
1358
+ </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1330
1359
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1331
1360
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1332
1361
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1333
1362
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1334
1363
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1335
- </xsl:template><xsl:template name="processMainSectionsDefault">
1364
+ </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1365
+ <xsl:for-each select="/*/*[local-name()='preface']/*">
1366
+ <xsl:sort select="@displayorder" data-type="number"/>
1367
+ <xsl:apply-templates select="."/>
1368
+ </xsl:for-each>
1369
+ </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1336
1370
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1337
1371
 
1338
1372
  <!-- Normative references -->
@@ -1344,6 +1378,22 @@
1344
1378
  <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1345
1379
  <!-- Bibliography -->
1346
1380
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1381
+ </xsl:template><xsl:template name="processMainSectionsDefault">
1382
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1383
+ <xsl:sort select="@displayorder" data-type="number"/>
1384
+ <xsl:apply-templates select="."/>
1385
+
1386
+ </xsl:for-each>
1387
+
1388
+ <xsl:for-each select="/*/*[local-name()='annex']">
1389
+ <xsl:sort select="@displayorder" data-type="number"/>
1390
+ <xsl:apply-templates select="."/>
1391
+ </xsl:for-each>
1392
+
1393
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1394
+ <xsl:sort select="@displayorder" data-type="number"/>
1395
+ <xsl:apply-templates select="."/>
1396
+ </xsl:for-each>
1347
1397
  </xsl:template><xsl:template match="text()">
1348
1398
  <xsl:value-of select="."/>
1349
1399
  </xsl:template><xsl:template match="*[local-name()='br']">
@@ -2188,9 +2238,8 @@
2188
2238
 
2189
2239
  <!-- Table's note name (NOTE, for example) -->
2190
2240
 
2191
- <fo:inline padding-right="2mm">
2241
+ <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
2192
2242
 
2193
-
2194
2243
 
2195
2244
 
2196
2245
 
@@ -2798,6 +2847,8 @@
2798
2847
  <xsl:if test="$font-size != ''">
2799
2848
  <xsl:attribute name="font-size">
2800
2849
  <xsl:choose>
2850
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
2851
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
2801
2852
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2802
2853
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2803
2854
  </xsl:choose>
@@ -3597,6 +3648,7 @@
3597
3648
  <xsl:otherwise>
3598
3649
  <fo:block xsl:use-attribute-sets="image-style">
3599
3650
 
3651
+
3600
3652
  <xsl:variable name="src">
3601
3653
  <xsl:call-template name="image_src"/>
3602
3654
  </xsl:variable>
@@ -3844,6 +3896,13 @@
3844
3896
  </xsl:attribute>
3845
3897
  <xsl:apply-templates mode="svg_update"/>
3846
3898
  </xsl:copy>
3899
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
3900
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3901
+ <xsl:for-each select="*[local-name() = 'svg']">
3902
+ <xsl:call-template name="image_svg">
3903
+ <xsl:with-param name="name" select="$name"/>
3904
+ </xsl:call-template>
3905
+ </xsl:for-each>
3847
3906
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3848
3907
  <xsl:variable name="svg_content" select="document(@src)"/>
3849
3908
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -3948,7 +4007,7 @@
3948
4007
  </fo:basic-link>
3949
4008
  </fo:block>
3950
4009
  </fo:block-container>
3951
- </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">
4010
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><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">
3952
4011
  <xsl:apply-templates mode="contents"/>
3953
4012
  <xsl:text> </xsl:text>
3954
4013
  </xsl:template><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="bookmarks">
@@ -3956,7 +4015,7 @@
3956
4015
  <xsl:text> </xsl:text>
3957
4016
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
3958
4017
  <xsl:value-of select="."/>
3959
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4018
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
3960
4019
  <xsl:value-of select="."/>
3961
4020
  </xsl:template><xsl:template match="node()" mode="contents">
3962
4021
  <xsl:apply-templates mode="contents"/>
@@ -4054,6 +4113,8 @@
4054
4113
 
4055
4114
 
4056
4115
 
4116
+
4117
+
4057
4118
  </fo:bookmark-tree>
4058
4119
  </xsl:if>
4059
4120
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -4247,12 +4308,16 @@
4247
4308
  <xsl:if test="$font-size != ''">
4248
4309
  <xsl:attribute name="font-size">
4249
4310
  <xsl:choose>
4311
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4312
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4250
4313
  <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4251
4314
  <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4252
4315
  </xsl:choose>
4253
4316
  </xsl:attribute>
4254
4317
  </xsl:if>
4255
4318
 
4319
+
4320
+
4256
4321
  <xsl:apply-templates/>
4257
4322
  </fo:block>
4258
4323
 
@@ -4600,6 +4665,7 @@
4600
4665
  </xsl:choose>
4601
4666
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4602
4667
  <fo:block xsl:use-attribute-sets="termsource-style">
4668
+
4603
4669
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4604
4670
  <xsl:variable name="termsource_text">
4605
4671
  <xsl:apply-templates/>
@@ -4624,14 +4690,15 @@
4624
4690
  </xsl:if>
4625
4691
  </xsl:template><xsl:variable name="localized.source">
4626
4692
  <xsl:call-template name="getLocalizedString">
4627
- <xsl:with-param name="key">source</xsl:with-param>
4628
- </xsl:call-template>
4693
+ <xsl:with-param name="key">source</xsl:with-param>
4694
+ </xsl:call-template>
4629
4695
  </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4630
4696
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4631
4697
  <xsl:if test="normalize-space(@citeas) = ''">
4632
4698
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4633
4699
  </xsl:if>
4634
4700
 
4701
+
4635
4702
  <fo:inline>
4636
4703
 
4637
4704
 
@@ -4639,6 +4706,7 @@
4639
4706
 
4640
4707
 
4641
4708
 
4709
+
4642
4710
  <xsl:call-template name="getTitle">
4643
4711
  <xsl:with-param name="name" select="'title-source'"/>
4644
4712
  </xsl:call-template>
@@ -4650,6 +4718,7 @@
4650
4718
  <fo:inline xsl:use-attribute-sets="origin-style">
4651
4719
  <xsl:apply-templates/>
4652
4720
  </fo:inline>
4721
+
4653
4722
  </fo:basic-link>
4654
4723
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4655
4724
  <fo:inline><xsl:apply-templates/></fo:inline>
@@ -4716,6 +4785,9 @@
4716
4785
 
4717
4786
  </xsl:if>
4718
4787
 
4788
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
4789
+ <xsl:variable name="text" select="normalize-space()"/>
4790
+
4719
4791
 
4720
4792
 
4721
4793
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
@@ -4731,7 +4803,9 @@
4731
4803
 
4732
4804
 
4733
4805
  </xsl:if>
4734
-
4806
+
4807
+
4808
+
4735
4809
  <xsl:apply-templates/>
4736
4810
  </fo:basic-link>
4737
4811
 
@@ -5059,6 +5133,7 @@
5059
5133
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5060
5134
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5061
5135
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5136
+
5062
5137
  <xsl:apply-templates/>
5063
5138
  </fo:block>
5064
5139
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -5227,9 +5302,97 @@
5227
5302
  <fo:block-container border="1pt solid black" width="50%">
5228
5303
  <fo:block> </fo:block>
5229
5304
  </fo:block-container>
5305
+ </xsl:template><xsl:template match="*[local-name() = 'toc']">
5306
+ <xsl:param name="colwidths"/>
5307
+ <xsl:variable name="colwidths_">
5308
+ <xsl:choose>
5309
+ <xsl:when test="not($colwidths)">
5310
+ <xsl:variable name="toc_table_simple">
5311
+ <tbody>
5312
+ <xsl:apply-templates mode="toc_table_width"/>
5313
+ </tbody>
5314
+ </xsl:variable>
5315
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
5316
+ <xsl:call-template name="calculate-column-widths">
5317
+ <xsl:with-param name="cols-count" select="$cols-count"/>
5318
+ <xsl:with-param name="table" select="$toc_table_simple"/>
5319
+ </xsl:call-template>
5320
+ </xsl:when>
5321
+ <xsl:otherwise>
5322
+ <xsl:copy-of select="$colwidths"/>
5323
+ </xsl:otherwise>
5324
+ </xsl:choose>
5325
+ </xsl:variable>
5326
+ <fo:block role="TOCI" space-after="16pt">
5327
+ <fo:table width="100%" table-layout="fixed">
5328
+ <xsl:for-each select="xalan:nodeset($colwidths_)/column">
5329
+ <fo:table-column column-width="proportional-column-width({.})"/>
5330
+ </xsl:for-each>
5331
+ <fo:table-body>
5332
+ <xsl:apply-templates/>
5333
+ </fo:table-body>
5334
+ </fo:table>
5335
+ </fo:block>
5336
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']">
5337
+ <fo:table-row min-height="5mm">
5338
+ <xsl:apply-templates/>
5339
+ </fo:table-row>
5340
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'li']/*[local-name() = 'p']">
5341
+ <xsl:apply-templates/>
5342
+ </xsl:template><xsl:template match="*[local-name() = 'toc']//*[local-name() = 'xref']" priority="3">
5343
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5344
+ <xsl:variable name="target" select="@target"/>
5345
+ <xsl:for-each select="*[local-name() = 'tab']">
5346
+ <xsl:variable name="current_id" select="generate-id()"/>
5347
+ <fo:table-cell>
5348
+ <fo:block>
5349
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5350
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5351
+ <xsl:choose>
5352
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
5353
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
5354
+ </xsl:choose>
5355
+ </xsl:for-each>
5356
+ </fo:basic-link>
5357
+ </fo:block>
5358
+ </fo:table-cell>
5359
+ </xsl:for-each>
5360
+ <!-- last column - for page numbers -->
5361
+ <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
5362
+ <fo:block>
5363
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
5364
+ <fo:page-number-citation ref-id="{$target}"/>
5365
+ </fo:basic-link>
5366
+ </fo:block>
5367
+ </fo:table-cell>
5368
+ </xsl:template><xsl:template match="*" mode="toc_table_width">
5369
+ <xsl:apply-templates mode="toc_table_width"/>
5370
+ </xsl:template><xsl:template match="*[local-name() = 'clause'][@type = 'toc']/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'clause'][not(@type = 'toc')]/*[local-name() = 'title']" mode="toc_table_width"/><xsl:template match="*[local-name() = 'li']" mode="toc_table_width">
5371
+ <tr>
5372
+ <xsl:apply-templates mode="toc_table_width"/>
5373
+ </tr>
5374
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="toc_table_width">
5375
+ <!-- <xref target="cgpm9th1948r6">1.6.3<tab/>&#8220;9th CGPM, 1948:<tab/>decision to establish the SI&#8221;</xref> -->
5376
+ <xsl:for-each select="*[local-name() = 'tab']">
5377
+ <xsl:variable name="current_id" select="generate-id()"/>
5378
+ <td>
5379
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
5380
+ <xsl:copy-of select="."/>
5381
+ </xsl:for-each>
5382
+ </td>
5383
+ </xsl:for-each>
5384
+ <td>333</td> <!-- page number, just for fill -->
5230
5385
  </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5231
5386
  <fo:inline padding-right="5mm"> </fo:inline>
5232
5387
  <fo:inline><xsl:apply-templates/></fo:inline>
5388
+ </xsl:template><xsl:template match="*[local-name() = 'blacksquare']" name="blacksquare">
5389
+ <fo:inline padding-right="2.5mm" baseline-shift="5%">
5390
+ <fo:instream-foreign-object content-height="2mm" content-width="2mm" fox:alt-text="Quad">
5391
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" viewBox="0 0 2 2">
5392
+ <rect x="0" y="0" width="2" height="2" fill="black"/>
5393
+ </svg>
5394
+ </fo:instream-foreign-object>
5395
+ </fo:inline>
5233
5396
  </xsl:template><xsl:template name="convertDate">
5234
5397
  <xsl:param name="date"/>
5235
5398
  <xsl:param name="format" select="'short'"/>