metanorma-cc 1.7.4 → 1.7.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16288509334e991274063c83ad8dd4df27f5064eb72e38e708060785ac440253
4
- data.tar.gz: cf91c3a36c694b8188d198475a992e4c4b442b7e0836377e4521cb4412d004be
3
+ metadata.gz: ba921a96ef914fa2953f1496d9f0cdb1187fbf899fb290db3e292bacf14a3c63
4
+ data.tar.gz: a1200323fce7dc2df2e100a8fe37f3a41e583a7311666da0823e3e0687493574
5
5
  SHA512:
6
- metadata.gz: 370ae0b96c03a413cfe7d43bb6d1ec3a0dd17ec0098e70b323dc45d740d96af37c1c1ea639429e60280fd2b62b3a87135de319f93ccea082673c55af8605e1bb
7
- data.tar.gz: 59e4462db2c88d3096b4b216e67c8ebfcec2fda10f6abdc8459e1763a0baab19a434af8fb7f7d7f4e2c81da951e372762cfdd7f6af27fbf61f23a8578d935081
6
+ metadata.gz: 6c909ee60a09c15b24769d63cd7abbd23d56953e6c5d01018ed46f903a8a8c994491aea2937e318811f6332fba02fc6a8324cbad2ea18fe463cb93b2d6ed7f1c
7
+ data.tar.gz: aa2da60c821b1cefa7e1fef177ded1b9136a73a37b6d91ce449f3887a65e0a93642aad8cdfa7959507a4d73eb0677800a8f2e584f3a7473725d0394a7986945d
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  steps:
data/.rubocop.yml CHANGED
@@ -7,4 +7,4 @@ inherit_from:
7
7
  # ...
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.4
10
+ TargetRubyVersion: 2.5
@@ -204,6 +204,18 @@
204
204
  </zeroOrMore>
205
205
  </element>
206
206
  </define>
207
+ <define name="dt">
208
+ <element name="dt">
209
+ <optional>
210
+ <attribute name="id">
211
+ <data type="ID"/>
212
+ </attribute>
213
+ </optional>
214
+ <zeroOrMore>
215
+ <ref name="TextElement"/>
216
+ </zeroOrMore>
217
+ </element>
218
+ </define>
207
219
  <define name="example">
208
220
  <element name="example">
209
221
  <attribute name="id">
@@ -899,7 +911,7 @@
899
911
  </include>
900
912
  <!-- end overrides -->
901
913
  <define name="docsubtype">
902
- <element name="docsubtype">
914
+ <element name="subdoctype">
903
915
  <ref name="DocumentSubtype"/>
904
916
  </element>
905
917
  </define>
@@ -955,7 +967,34 @@
955
967
  <define name="concept">
956
968
  <element name="concept">
957
969
  <optional>
958
- <attribute name="term"/>
970
+ <attribute name="ital">
971
+ <data type="boolean"/>
972
+ </attribute>
973
+ </optional>
974
+ <optional>
975
+ <attribute name="ref">
976
+ <data type="boolean"/>
977
+ </attribute>
978
+ </optional>
979
+ <optional>
980
+ <element name="refterm">
981
+ <zeroOrMore>
982
+ <choice>
983
+ <ref name="PureTextElement"/>
984
+ <ref name="stem"/>
985
+ </choice>
986
+ </zeroOrMore>
987
+ </element>
988
+ </optional>
989
+ <optional>
990
+ <element name="renderterm">
991
+ <zeroOrMore>
992
+ <choice>
993
+ <ref name="PureTextElement"/>
994
+ <ref name="stem"/>
995
+ </choice>
996
+ </zeroOrMore>
997
+ </element>
959
998
  </optional>
960
999
  <choice>
961
1000
  <ref name="eref"/>
@@ -972,8 +1011,14 @@
972
1011
  <ref name="imagemap"/>
973
1012
  <ref name="svgmap"/>
974
1013
  <ref name="inputform"/>
1014
+ <ref name="toc"/>
975
1015
  </choice>
976
1016
  </define>
1017
+ <define name="toc">
1018
+ <element name="toc">
1019
+ <ref name="ul"/>
1020
+ </element>
1021
+ </define>
977
1022
  <define name="inputform">
978
1023
  <element name="form">
979
1024
  <attribute name="id">
@@ -981,6 +1026,9 @@
981
1026
  </attribute>
982
1027
  <attribute name="name"/>
983
1028
  <attribute name="action"/>
1029
+ <optional>
1030
+ <attribute name="class"/>
1031
+ </optional>
984
1032
  <zeroOrMore>
985
1033
  <choice>
986
1034
  <ref name="TextElement"/>
@@ -1212,6 +1260,12 @@
1212
1260
  <optional>
1213
1261
  <attribute name="type"/>
1214
1262
  </optional>
1263
+ <optional>
1264
+ <attribute name="identifier"/>
1265
+ </optional>
1266
+ <optional>
1267
+ <attribute name="prefix"/>
1268
+ </optional>
1215
1269
  <text/>
1216
1270
  </define>
1217
1271
  <define name="ics">
@@ -1473,26 +1527,26 @@
1473
1527
  <optional>
1474
1528
  <ref name="section-title"/>
1475
1529
  </optional>
1476
- <group>
1530
+ <choice>
1477
1531
  <choice>
1478
1532
  <group>
1479
- <zeroOrMore>
1533
+ <oneOrMore>
1480
1534
  <ref name="BasicBlock"/>
1481
- </zeroOrMore>
1535
+ </oneOrMore>
1482
1536
  <zeroOrMore>
1483
1537
  <ref name="note"/>
1484
1538
  </zeroOrMore>
1485
1539
  </group>
1486
1540
  <ref name="amend"/>
1487
1541
  </choice>
1488
- <zeroOrMore>
1542
+ <oneOrMore>
1489
1543
  <choice>
1490
1544
  <ref name="clause-subsection"/>
1491
1545
  <ref name="terms"/>
1492
1546
  <ref name="definitions"/>
1493
1547
  </choice>
1494
- </zeroOrMore>
1495
- </group>
1548
+ </oneOrMore>
1549
+ </choice>
1496
1550
  </define>
1497
1551
  <define name="Annex-Section">
1498
1552
  <optional>
@@ -7,8 +7,13 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
- <xsl:variable name="pageWidth" select="'210mm'"/>
11
- <xsl:variable name="pageHeight" select="'297mm'"/>
10
+ <xsl:variable name="pageWidth" select="210"/>
11
+ <xsl:variable name="pageHeight" select="297"/>
12
+ <xsl:variable name="marginLeftRight1" select="19"/>
13
+ <xsl:variable name="marginLeftRight2" select="19"/>
14
+ <xsl:variable name="marginTop" select="20.2"/>
15
+ <xsl:variable name="marginBottom" select="20.3"/>
16
+
12
17
 
13
18
 
14
19
 
@@ -42,7 +47,7 @@
42
47
  <fo:root font-family="Source Sans Pro, STIX Two Math, Source Han Sans" font-size="10.5pt" xml:lang="{$lang}">
43
48
  <fo:layout-master-set>
44
49
  <!-- Cover page -->
45
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
50
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
46
51
  <fo:region-body margin-top="23.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
47
52
  <fo:region-before region-name="cover-page-header" extent="23.5mm"/>
48
53
  <fo:region-after extent="10mm"/>
@@ -53,27 +58,27 @@
53
58
  <!-- Document pages -->
54
59
 
55
60
  <!-- Preface odd pages -->
56
- <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
57
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
61
+ <fo:simple-page-master master-name="odd-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
62
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
58
63
  <fo:region-before region-name="header-odd" extent="17mm"/>
59
64
  <fo:region-after region-name="footer-odd" extent="10mm"/>
60
- <fo:region-start region-name="left-region" extent="19mm"/>
61
- <fo:region-end region-name="right-region" extent="19mm"/>
65
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
66
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
62
67
  </fo:simple-page-master>
63
68
  <!-- Preface even pages -->
64
- <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}" page-height="{$pageHeight}">
65
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
69
+ <fo:simple-page-master master-name="even-preface" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
70
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
66
71
  <fo:region-before region-name="header-even" extent="17mm"/>
67
72
  <fo:region-after region-name="footer-even" extent="10mm"/>
68
- <fo:region-start region-name="left-region" extent="19mm"/>
69
- <fo:region-end region-name="right-region" extent="19mm"/>
73
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
74
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
70
75
  </fo:simple-page-master>
71
- <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}" page-height="{$pageHeight}">
72
- <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
76
+ <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
77
+ <fo:region-body margin-top="17mm" margin-bottom="10mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
73
78
  <fo:region-before region-name="header" extent="17mm"/>
74
79
  <fo:region-after region-name="footer" extent="10mm"/>
75
- <fo:region-start region-name="left" extent="19mm"/>
76
- <fo:region-end region-name="right" extent="19mm"/>
80
+ <fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
81
+ <fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
77
82
  </fo:simple-page-master>
78
83
  <fo:page-sequence-master master-name="preface">
79
84
  <fo:repeatable-page-master-alternatives>
@@ -84,20 +89,20 @@
84
89
  </fo:page-sequence-master>
85
90
 
86
91
  <!-- Document odd pages -->
87
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
88
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
89
- <fo:region-before region-name="header-odd" extent="20.2mm"/>
90
- <fo:region-after region-name="footer-odd" extent="20.3mm"/>
91
- <fo:region-start region-name="left-region" extent="19mm"/>
92
- <fo:region-end region-name="right-region" extent="19mm"/>
92
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
93
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
94
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
95
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
96
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
97
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
93
98
  </fo:simple-page-master>
94
99
  <!-- Preface even pages -->
95
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
96
- <fo:region-body margin-top="20.2mm" margin-bottom="20.3mm" margin-left="19mm" margin-right="19mm"/>
97
- <fo:region-before region-name="header-even" extent="20.2mm"/>
98
- <fo:region-after region-name="footer-even" extent="20.3mm"/>
99
- <fo:region-start region-name="left-region" extent="19mm"/>
100
- <fo:region-end region-name="right-region" extent="19mm"/>
100
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
101
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
102
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
103
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
104
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
105
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
101
106
  </fo:simple-page-master>
102
107
  <fo:page-sequence-master master-name="document">
103
108
  <fo:repeatable-page-master-alternatives>
@@ -1018,7 +1023,7 @@
1018
1023
 
1019
1024
 
1020
1025
 
1021
-
1026
+
1022
1027
  </xsl:attribute-set><xsl:attribute-set name="example-style">
1023
1028
 
1024
1029
 
@@ -1085,7 +1090,10 @@
1085
1090
 
1086
1091
 
1087
1092
 
1088
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
1093
+
1094
+ </xsl:attribute-set><xsl:variable name="table-border_">
1095
+
1096
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
1089
1097
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1090
1098
 
1091
1099
 
@@ -1105,6 +1113,8 @@
1105
1113
 
1106
1114
 
1107
1115
 
1116
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
1117
+
1108
1118
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1109
1119
 
1110
1120
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1131,6 +1141,7 @@
1131
1141
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1132
1142
 
1133
1143
 
1144
+
1134
1145
  <xsl:attribute name="color">blue</xsl:attribute>
1135
1146
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1136
1147
 
@@ -1156,6 +1167,7 @@
1156
1167
 
1157
1168
 
1158
1169
 
1170
+
1159
1171
  </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1160
1172
 
1161
1173
 
@@ -1198,10 +1210,12 @@
1198
1210
 
1199
1211
 
1200
1212
 
1213
+
1201
1214
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1202
1215
 
1203
1216
 
1204
1217
 
1218
+
1205
1219
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1206
1220
 
1207
1221
 
@@ -1260,6 +1274,7 @@
1260
1274
 
1261
1275
 
1262
1276
 
1277
+
1263
1278
 
1264
1279
 
1265
1280
 
@@ -1333,6 +1348,8 @@
1333
1348
  <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
1334
1349
 
1335
1350
 
1351
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
1352
+
1336
1353
  </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">
1337
1354
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1338
1355
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1343,14 +1360,15 @@
1343
1360
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1344
1361
 
1345
1362
  <!-- Normative references -->
1346
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1363
+ <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
1347
1364
  <!-- Terms and definitions -->
1348
1365
  <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"/>
1349
1366
  <!-- Another main sections -->
1350
1367
  <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"/>
1351
1368
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1352
1369
  <!-- Bibliography -->
1353
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1370
+ <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"/>
1371
+
1354
1372
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1355
1373
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1356
1374
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -1386,13 +1404,15 @@
1386
1404
  <xsl:variable name="table">
1387
1405
 
1388
1406
  <xsl:variable name="simple-table">
1389
- <xsl:call-template name="getSimpleTable"/>
1407
+ <xsl:call-template name="getSimpleTable"/>
1390
1408
  </xsl:variable>
1391
1409
 
1392
1410
  <!-- <xsl:if test="$namespace = 'bipm'">
1393
- <fo:block>&#xA0;</fo:block>
1411
+ <fo:block>&#xA0;</fo:block>
1394
1412
  </xsl:if> -->
1395
1413
 
1414
+
1415
+ <!-- Display table's name before table as standalone block -->
1396
1416
  <!-- $namespace = 'iso' or -->
1397
1417
 
1398
1418
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -1470,6 +1490,12 @@
1470
1490
 
1471
1491
 
1472
1492
 
1493
+
1494
+
1495
+
1496
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1497
+
1498
+
1473
1499
  <xsl:variable name="table_width">
1474
1500
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1475
1501
  100%
@@ -1488,12 +1514,14 @@
1488
1514
 
1489
1515
 
1490
1516
 
1517
+
1491
1518
 
1492
1519
 
1493
1520
 
1494
1521
 
1495
1522
 
1496
1523
 
1524
+
1497
1525
  </xsl:variable>
1498
1526
 
1499
1527
 
@@ -1635,6 +1663,9 @@
1635
1663
  <fo:block xsl:use-attribute-sets="table-name-style">
1636
1664
 
1637
1665
 
1666
+
1667
+
1668
+
1638
1669
  <xsl:choose>
1639
1670
  <xsl:when test="$continued = 'true'">
1640
1671
  <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
@@ -1782,6 +1813,7 @@
1782
1813
  <!-- font-weight="bold" -->
1783
1814
  <fo:table-header>
1784
1815
 
1816
+
1785
1817
  <xsl:apply-templates/>
1786
1818
  </fo:table-header>
1787
1819
  </xsl:template><xsl:template name="table-header-title">
@@ -1906,6 +1938,8 @@
1906
1938
  </xsl:choose>
1907
1939
  </xsl:for-each>
1908
1940
 
1941
+
1942
+
1909
1943
  <xsl:choose>
1910
1944
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
1911
1945
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -1932,6 +1966,7 @@
1932
1966
 
1933
1967
 
1934
1968
 
1969
+
1935
1970
  <!-- fn will be processed inside 'note' processing -->
1936
1971
 
1937
1972
 
@@ -1940,6 +1975,11 @@
1940
1975
 
1941
1976
 
1942
1977
 
1978
+
1979
+
1980
+ <!-- for BSI (not PAS) display Notes before footnotes -->
1981
+
1982
+
1943
1983
  <!-- except gb -->
1944
1984
 
1945
1985
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -1965,6 +2005,10 @@
1965
2005
  <!-- fn processing -->
1966
2006
  <xsl:call-template name="fn_display"/>
1967
2007
 
2008
+
2009
+ <!-- for PAS display Notes after footnotes -->
2010
+
2011
+
1968
2012
  </fo:table-cell>
1969
2013
  </fo:table-row>
1970
2014
  </fo:table-body>
@@ -2018,15 +2062,24 @@
2018
2062
 
2019
2063
 
2020
2064
 
2065
+
2066
+
2021
2067
  </xsl:if>
2022
2068
  <xsl:if test="$parent-name = 'tfoot'">
2023
2069
 
2024
2070
 
2071
+
2025
2072
  </xsl:if>
2026
2073
 
2027
2074
 
2028
2075
 
2029
2076
 
2077
+
2078
+
2079
+
2080
+
2081
+
2082
+
2030
2083
  <!-- <xsl:if test="$namespace = 'bipm'">
2031
2084
  <xsl:attribute name="height">8mm</xsl:attribute>
2032
2085
  </xsl:if> -->
@@ -2112,6 +2165,10 @@
2112
2165
 
2113
2166
 
2114
2167
 
2168
+
2169
+
2170
+
2171
+
2115
2172
  <xsl:if test=".//*[local-name() = 'table']">
2116
2173
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2117
2174
  </xsl:if>
@@ -2141,8 +2198,14 @@
2141
2198
 
2142
2199
 
2143
2200
 
2201
+
2202
+
2203
+ <!-- Table's note name (NOTE, for example) -->
2204
+
2144
2205
  <fo:inline padding-right="2mm">
2145
2206
 
2207
+
2208
+
2146
2209
 
2147
2210
 
2148
2211
 
@@ -2150,6 +2213,8 @@
2150
2213
 
2151
2214
  </fo:inline>
2152
2215
 
2216
+
2217
+
2153
2218
  <xsl:apply-templates mode="process"/>
2154
2219
  </fo:block>
2155
2220
 
@@ -2169,6 +2234,8 @@
2169
2234
  <xsl:variable name="reference" select="@reference"/>
2170
2235
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2171
2236
  <fo:block margin-bottom="12pt">
2237
+
2238
+
2172
2239
 
2173
2240
 
2174
2241
 
@@ -2184,9 +2251,11 @@
2184
2251
 
2185
2252
 
2186
2253
 
2254
+
2187
2255
  <xsl:value-of select="@reference"/>
2188
2256
 
2189
2257
 
2258
+
2190
2259
  </fo:inline>
2191
2260
  <fo:inline>
2192
2261
 
@@ -2327,11 +2396,16 @@
2327
2396
 
2328
2397
 
2329
2398
 
2399
+
2400
+
2401
+
2402
+
2330
2403
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2331
2404
 
2332
2405
 
2333
2406
  <xsl:value-of select="@reference"/>
2334
2407
 
2408
+
2335
2409
  </fo:basic-link>
2336
2410
  </fo:inline>
2337
2411
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2629,6 +2703,7 @@
2629
2703
 
2630
2704
  <fo:table-row>
2631
2705
 
2706
+
2632
2707
  <fo:table-cell>
2633
2708
 
2634
2709
  <fo:block margin-top="6pt">
@@ -2646,6 +2721,7 @@
2646
2721
 
2647
2722
 
2648
2723
 
2724
+
2649
2725
  <xsl:apply-templates/>
2650
2726
  <!-- <xsl:if test="$namespace = 'gb'">
2651
2727
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3193,7 +3269,15 @@
3193
3269
  <xsl:copy>
3194
3270
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
3195
3271
  </xsl:copy>
3196
- <mathml:mspace width="0.5ex"/>
3272
+ <xsl:choose>
3273
+ <!-- if in msub, then don't add space -->
3274
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
3275
+ <!-- if next char in digit, don't add space -->
3276
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
3277
+ <xsl:otherwise>
3278
+ <mathml:mspace width="0.5ex"/>
3279
+ </xsl:otherwise>
3280
+ </xsl:choose>
3197
3281
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
3198
3282
  <xsl:variable name="target">
3199
3283
  <xsl:choose>
@@ -3217,6 +3301,8 @@
3217
3301
  </xsl:variable>
3218
3302
  <fo:inline xsl:use-attribute-sets="link-style">
3219
3303
 
3304
+
3305
+
3220
3306
  <xsl:choose>
3221
3307
  <xsl:when test="$target_text = ''">
3222
3308
  <xsl:apply-templates/>
@@ -3325,6 +3411,7 @@
3325
3411
 
3326
3412
 
3327
3413
 
3414
+
3328
3415
  <fo:block-container margin-left="0mm">
3329
3416
 
3330
3417
 
@@ -3368,6 +3455,7 @@
3368
3455
  </xsl:choose>
3369
3456
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
3370
3457
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3458
+
3371
3459
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3372
3460
 
3373
3461
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
@@ -3441,6 +3529,7 @@
3441
3529
  </xsl:call-template>
3442
3530
 
3443
3531
  <fo:block>
3532
+
3444
3533
  <xsl:apply-templates/>
3445
3534
  </fo:block>
3446
3535
  <xsl:call-template name="fn_display_figure"/>
@@ -3495,7 +3584,24 @@
3495
3584
  </fo:instream-foreign-object>
3496
3585
  </xsl:when>
3497
3586
  <xsl:otherwise>
3498
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
3587
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
3588
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
3589
+
3590
+ <xsl:variable name="img_src">
3591
+ <xsl:choose>
3592
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
3593
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
3594
+ </xsl:choose>
3595
+ </xsl:variable>
3596
+
3597
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
3598
+ <xsl:if test="number($scale) &lt; 100">
3599
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
3600
+ </xsl:if>
3601
+
3602
+ </xsl:if>
3603
+
3604
+ </fo:external-graphic>
3499
3605
  </xsl:otherwise>
3500
3606
  </xsl:choose>
3501
3607
 
@@ -3563,6 +3669,253 @@
3563
3669
  <xsl:param name="height"/>
3564
3670
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
3565
3671
  <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
3672
+ </xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
3673
+ <xsl:param name="name"/>
3674
+
3675
+ <xsl:variable name="svg_content">
3676
+ <xsl:apply-templates select="." mode="svg_update"/>
3677
+ </xsl:variable>
3678
+
3679
+ <xsl:variable name="alt-text">
3680
+ <xsl:choose>
3681
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
3682
+ <xsl:value-of select="../*[local-name() = 'name']"/>
3683
+ </xsl:when>
3684
+ <xsl:when test="normalize-space($name) != ''">
3685
+ <xsl:value-of select="$name"/>
3686
+ </xsl:when>
3687
+ <xsl:otherwise>Figure</xsl:otherwise>
3688
+ </xsl:choose>
3689
+ </xsl:variable>
3690
+
3691
+ <xsl:choose>
3692
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
3693
+ <fo:block>
3694
+ <xsl:variable name="width" select="@width"/>
3695
+ <xsl:variable name="height" select="@height"/>
3696
+
3697
+ <xsl:variable name="scale_x">
3698
+ <xsl:choose>
3699
+ <xsl:when test="$width &gt; $width_effective_px">
3700
+ <xsl:value-of select="$width_effective_px div $width"/>
3701
+ </xsl:when>
3702
+ <xsl:otherwise>1</xsl:otherwise>
3703
+ </xsl:choose>
3704
+ </xsl:variable>
3705
+
3706
+ <xsl:variable name="scale_y">
3707
+ <xsl:choose>
3708
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
3709
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
3710
+ </xsl:when>
3711
+ <xsl:otherwise>1</xsl:otherwise>
3712
+ </xsl:choose>
3713
+ </xsl:variable>
3714
+
3715
+ <xsl:variable name="scale">
3716
+ <xsl:choose>
3717
+ <xsl:when test="$scale_y != 1">
3718
+ <xsl:value-of select="$scale_x * $scale_y"/>
3719
+ </xsl:when>
3720
+ <xsl:otherwise>
3721
+ <xsl:value-of select="$scale_x"/>
3722
+ </xsl:otherwise>
3723
+ </xsl:choose>
3724
+ </xsl:variable>
3725
+
3726
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
3727
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
3728
+
3729
+ <fo:table table-layout="fixed" width="100%">
3730
+ <fo:table-column column-width="proportional-column-width(1)"/>
3731
+ <fo:table-column column-width="{$width_scale}px"/>
3732
+ <fo:table-column column-width="proportional-column-width(1)"/>
3733
+ <fo:table-body>
3734
+ <fo:table-row>
3735
+ <fo:table-cell column-number="2">
3736
+ <fo:block>
3737
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
3738
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3739
+ <fo:block line-height="0" font-size="0">
3740
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3741
+ <xsl:call-template name="bookmark"/>
3742
+ </xsl:for-each>
3743
+ </fo:block>
3744
+ </xsl:if>
3745
+ <fo:block text-depth="0" line-height="0" font-size="0">
3746
+
3747
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3748
+ <xsl:attribute name="width">100%</xsl:attribute>
3749
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3750
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3751
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3752
+
3753
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
3754
+ </fo:instream-foreign-object>
3755
+ </fo:block>
3756
+
3757
+ <xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
3758
+ <xsl:with-param name="scale" select="$scale"/>
3759
+ </xsl:apply-templates>
3760
+ </fo:block-container>
3761
+ </fo:block>
3762
+ </fo:table-cell>
3763
+ </fo:table-row>
3764
+ </fo:table-body>
3765
+ </fo:table>
3766
+ </fo:block>
3767
+
3768
+ </xsl:when>
3769
+ <xsl:otherwise>
3770
+ <fo:block xsl:use-attribute-sets="image-style">
3771
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3772
+ <xsl:attribute name="width">100%</xsl:attribute>
3773
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3774
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3775
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
3776
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
3777
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3778
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3779
+ <!-- effective height / width = 1.48, 1.4 - with title -->
3780
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
3781
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
3782
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3783
+ </xsl:if>
3784
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3785
+ <xsl:copy-of select="$svg_content"/>
3786
+ </fo:instream-foreign-object>
3787
+ </fo:block>
3788
+ </xsl:otherwise>
3789
+ </xsl:choose>
3790
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
3791
+ <xsl:copy>
3792
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
3793
+ </xsl:copy>
3794
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
3795
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3796
+ <xsl:value-of select="."/>
3797
+ </xsl:attribute>
3798
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
3799
+ <xsl:copy>
3800
+ <xsl:apply-templates select="@*" mode="svg_update"/>
3801
+ <xsl:variable name="viewbox">
3802
+ <xsl:call-template name="split">
3803
+ <xsl:with-param name="pText" select="@viewBox"/>
3804
+ <xsl:with-param name="sep" select="' '"/>
3805
+ </xsl:call-template>
3806
+ </xsl:variable>
3807
+ <xsl:attribute name="width">
3808
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
3809
+ </xsl:attribute>
3810
+ <xsl:attribute name="height">
3811
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
3812
+ </xsl:attribute>
3813
+ <xsl:apply-templates mode="svg_update"/>
3814
+ </xsl:copy>
3815
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3816
+ <xsl:variable name="svg_content" select="document(@src)"/>
3817
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3818
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
3819
+ <xsl:call-template name="image_svg">
3820
+ <xsl:with-param name="name" select="$name"/>
3821
+ </xsl:call-template>
3822
+ </xsl:for-each>
3823
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
3824
+ <xsl:copy>
3825
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
3826
+ </xsl:copy>
3827
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
3828
+ <xsl:apply-templates mode="svg_remove_a"/>
3829
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
3830
+ <xsl:param name="scale"/>
3831
+ <xsl:variable name="dest">
3832
+ <xsl:choose>
3833
+ <xsl:when test="starts-with(@href, '#')">
3834
+ <xsl:value-of select="substring-after(@href, '#')"/>
3835
+ </xsl:when>
3836
+ <xsl:otherwise>
3837
+ <xsl:value-of select="@href"/>
3838
+ </xsl:otherwise>
3839
+ </xsl:choose>
3840
+ </xsl:variable>
3841
+ <xsl:for-each select="./*[local-name() = 'rect']">
3842
+ <xsl:call-template name="insertSVGMapLink">
3843
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
3844
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
3845
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
3846
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
3847
+ <xsl:with-param name="dest" select="$dest"/>
3848
+ </xsl:call-template>
3849
+ </xsl:for-each>
3850
+
3851
+ <xsl:for-each select="./*[local-name() = 'polygon']">
3852
+ <xsl:variable name="points">
3853
+ <xsl:call-template name="split">
3854
+ <xsl:with-param name="pText" select="@points"/>
3855
+ </xsl:call-template>
3856
+ </xsl:variable>
3857
+ <xsl:variable name="x_coords">
3858
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
3859
+ <xsl:sort select="." data-type="number"/>
3860
+ <x><xsl:value-of select="."/></x>
3861
+ </xsl:for-each>
3862
+ </xsl:variable>
3863
+ <xsl:variable name="y_coords">
3864
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
3865
+ <xsl:sort select="." data-type="number"/>
3866
+ <y><xsl:value-of select="."/></y>
3867
+ </xsl:for-each>
3868
+ </xsl:variable>
3869
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
3870
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
3871
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
3872
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
3873
+ <xsl:call-template name="insertSVGMapLink">
3874
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
3875
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
3876
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
3877
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
3878
+ <xsl:with-param name="dest" select="$dest"/>
3879
+ </xsl:call-template>
3880
+ </xsl:for-each>
3881
+
3882
+ <xsl:for-each select="./*[local-name() = 'circle']">
3883
+ <xsl:call-template name="insertSVGMapLink">
3884
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
3885
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
3886
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
3887
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
3888
+ <xsl:with-param name="dest" select="$dest"/>
3889
+ </xsl:call-template>
3890
+ </xsl:for-each>
3891
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
3892
+ <xsl:call-template name="insertSVGMapLink">
3893
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
3894
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
3895
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
3896
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
3897
+ <xsl:with-param name="dest" select="$dest"/>
3898
+ </xsl:call-template>
3899
+ </xsl:for-each>
3900
+ </xsl:template><xsl:template name="insertSVGMapLink">
3901
+ <xsl:param name="left"/>
3902
+ <xsl:param name="top"/>
3903
+ <xsl:param name="width"/>
3904
+ <xsl:param name="height"/>
3905
+ <xsl:param name="dest"/>
3906
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
3907
+ <fo:block font-size="1pt">
3908
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
3909
+ <fo:inline-container inline-progression-dimension="100%">
3910
+ <fo:block-container height="{$height - 1}px" width="100%">
3911
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
3912
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
3913
+ </xsl:if> -->
3914
+ <fo:block> </fo:block></fo:block-container>
3915
+ </fo:inline-container>
3916
+ </fo:basic-link>
3917
+ </fo:block>
3918
+ </fo:block-container>
3566
3919
  </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">
3567
3920
  <xsl:apply-templates mode="contents"/>
3568
3921
  <xsl:text> </xsl:text>
@@ -3591,28 +3944,39 @@
3591
3944
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3592
3945
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3593
3946
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3947
+ <xsl:if test="@bundle = 'true'">
3948
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
3949
+ </xsl:if>
3594
3950
  <fo:bookmark-title>
3595
- <xsl:variable name="bookmark-title_">
3596
- <xsl:call-template name="getLangVersion">
3597
- <xsl:with-param name="lang" select="@lang"/>
3598
- <xsl:with-param name="doctype" select="@doctype"/>
3599
- <xsl:with-param name="title" select="@title-part"/>
3600
- </xsl:call-template>
3601
- </xsl:variable>
3602
3951
  <xsl:choose>
3603
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3604
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3605
- </xsl:when>
3606
- <xsl:otherwise>
3952
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
3953
+ <xsl:variable name="bookmark-title_">
3954
+ <xsl:call-template name="getLangVersion">
3955
+ <xsl:with-param name="lang" select="@lang"/>
3956
+ <xsl:with-param name="doctype" select="@doctype"/>
3957
+ <xsl:with-param name="title" select="@title-part"/>
3958
+ </xsl:call-template>
3959
+ </xsl:variable>
3607
3960
  <xsl:choose>
3608
- <xsl:when test="@lang = 'en'">English</xsl:when>
3609
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3610
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3611
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3961
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3962
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3963
+ </xsl:when>
3964
+ <xsl:otherwise>
3965
+ <xsl:choose>
3966
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3967
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3968
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3969
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3970
+ </xsl:choose>
3971
+ </xsl:otherwise>
3612
3972
  </xsl:choose>
3973
+ </xsl:when>
3974
+ <xsl:otherwise>
3975
+ <xsl:value-of select="@title-part"/>
3613
3976
  </xsl:otherwise>
3614
3977
  </xsl:choose>
3615
3978
  </fo:bookmark-title>
3979
+
3616
3980
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3617
3981
 
3618
3982
  <xsl:call-template name="insertFigureBookmarks">
@@ -3711,20 +4075,28 @@
3711
4075
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3712
4076
  </xsl:choose>
3713
4077
  </xsl:template><xsl:template match="item" mode="bookmark">
3714
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3715
- <fo:bookmark-title>
3716
- <xsl:if test="@section != ''">
3717
- <xsl:value-of select="@section"/>
3718
- <xsl:text> </xsl:text>
3719
- </xsl:if>
3720
- <xsl:value-of select="normalize-space(title)"/>
3721
- </fo:bookmark-title>
3722
- <xsl:apply-templates mode="bookmark"/>
3723
- </fo:bookmark>
4078
+ <xsl:choose>
4079
+ <xsl:when test="@id != ''">
4080
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4081
+ <fo:bookmark-title>
4082
+ <xsl:if test="@section != ''">
4083
+ <xsl:value-of select="@section"/>
4084
+ <xsl:text> </xsl:text>
4085
+ </xsl:if>
4086
+ <xsl:value-of select="normalize-space(title)"/>
4087
+ </fo:bookmark-title>
4088
+ <xsl:apply-templates mode="bookmark"/>
4089
+ </fo:bookmark>
4090
+ </xsl:when>
4091
+ <xsl:otherwise>
4092
+ <xsl:apply-templates mode="bookmark"/>
4093
+ </xsl:otherwise>
4094
+ </xsl:choose>
3724
4095
  </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3725
4096
  <xsl:if test="normalize-space() != ''">
3726
4097
  <fo:block xsl:use-attribute-sets="figure-name-style">
3727
4098
 
4099
+
3728
4100
  <xsl:apply-templates/>
3729
4101
  </fo:block>
3730
4102
  </xsl:if>
@@ -3805,6 +4177,7 @@
3805
4177
 
3806
4178
  <fo:block-container margin-left="0mm">
3807
4179
  <xsl:copy-of select="@id"/>
4180
+
3808
4181
  <xsl:if test="parent::*[local-name() = 'note']">
3809
4182
  <xsl:attribute name="margin-left">
3810
4183
  <xsl:choose>
@@ -3815,7 +4188,9 @@
3815
4188
 
3816
4189
  </xsl:if>
3817
4190
  <fo:block-container margin-left="0mm">
3818
-
4191
+
4192
+
4193
+
3819
4194
  <fo:block xsl:use-attribute-sets="sourcecode-style">
3820
4195
  <xsl:variable name="_font-size">
3821
4196
 
@@ -3844,10 +4219,14 @@
3844
4219
  </xsl:choose>
3845
4220
  </xsl:attribute>
3846
4221
  </xsl:if>
3847
- <xsl:apply-templates/>
3848
- </fo:block>
4222
+
4223
+ <xsl:apply-templates/>
4224
+ </fo:block>
4225
+
4226
+
3849
4227
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3850
4228
 
4229
+
3851
4230
  </fo:block-container>
3852
4231
  </fo:block-container>
3853
4232
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4193,6 +4572,8 @@
4193
4572
 
4194
4573
 
4195
4574
 
4575
+
4576
+
4196
4577
  <xsl:call-template name="getTitle">
4197
4578
  <xsl:with-param name="name" select="'title-source'"/>
4198
4579
  </xsl:call-template>
@@ -4269,7 +4650,9 @@
4269
4650
 
4270
4651
 
4271
4652
  </xsl:if>
4272
-
4653
+
4654
+
4655
+
4273
4656
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4274
4657
  <xsl:if test="normalize-space(@citeas) = ''">
4275
4658
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
@@ -4281,6 +4664,7 @@
4281
4664
 
4282
4665
 
4283
4666
 
4667
+
4284
4668
  </xsl:if>
4285
4669
 
4286
4670
  <xsl:apply-templates/>
@@ -4427,6 +4811,7 @@
4427
4811
  <xsl:call-template name="setId"/>
4428
4812
 
4429
4813
 
4814
+
4430
4815
  <xsl:apply-templates/>
4431
4816
  </fo:block>
4432
4817
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4673,17 +5058,17 @@
4673
5058
  <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4674
5059
  <xsl:choose>
4675
5060
  <xsl:when test="normalize-space($_doc_ident) != ''">
4676
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
5061
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4677
5062
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4678
5063
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4679
- </xsl:if>
5064
+ </xsl:if> -->
4680
5065
  <xsl:value-of select="$_doc_ident"/>
4681
5066
  </xsl:when>
4682
5067
  <xsl:otherwise>
4683
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5068
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4684
5069
  <xsl:if test="$type != ''">
4685
5070
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4686
- </xsl:if>
5071
+ </xsl:if> -->
4687
5072
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4688
5073
  </xsl:otherwise>
4689
5074
  </xsl:choose>
@@ -5124,20 +5509,40 @@
5124
5509
  </xsl:call-template>
5125
5510
  </xsl:if>
5126
5511
  </xsl:template><xsl:template name="getLocalizedString">
5127
- <xsl:param name="key"/>
5512
+ <xsl:param name="key"/>
5513
+ <xsl:param name="formatted">false</xsl:param>
5128
5514
 
5129
5515
  <xsl:variable name="curr_lang">
5130
5516
  <xsl:call-template name="getLang"/>
5131
5517
  </xsl:variable>
5132
5518
 
5133
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5519
+ <xsl:variable name="data_value">
5520
+ <xsl:choose>
5521
+ <xsl:when test="$formatted = 'true'">
5522
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5523
+ </xsl:when>
5524
+ <xsl:otherwise>
5525
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
5526
+ </xsl:otherwise>
5527
+ </xsl:choose>
5528
+ </xsl:variable>
5134
5529
 
5135
5530
  <xsl:choose>
5136
- <xsl:when test="$data_value != ''">
5137
- <xsl:value-of select="$data_value"/>
5531
+ <xsl:when test="normalize-space($data_value) != ''">
5532
+ <xsl:choose>
5533
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
5534
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
5535
+ </xsl:choose>
5138
5536
  </xsl:when>
5139
5537
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5140
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5538
+ <xsl:choose>
5539
+ <xsl:when test="$formatted = 'true'">
5540
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5541
+ </xsl:when>
5542
+ <xsl:otherwise>
5543
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5544
+ </xsl:otherwise>
5545
+ </xsl:choose>
5141
5546
  </xsl:when>
5142
5547
  <xsl:otherwise>
5143
5548
  <xsl:variable name="key_">
@@ -5148,7 +5553,7 @@
5148
5553
  <xsl:value-of select="$key_"/>
5149
5554
  </xsl:otherwise>
5150
5555
  </xsl:choose>
5151
-
5556
+
5152
5557
  </xsl:template><xsl:template name="setTrackChangesStyles">
5153
5558
  <xsl:param name="isAdded"/>
5154
5559
  <xsl:param name="isDeleted"/>
@@ -5189,4 +5594,110 @@
5189
5594
  <xsl:value-of select="$align"/>
5190
5595
  </xsl:when>
5191
5596
  </xsl:choose>
5597
+ </xsl:template><xsl:template name="setTextAlignment">
5598
+ <xsl:param name="default">left</xsl:param>
5599
+ <xsl:attribute name="text-align">
5600
+ <xsl:choose>
5601
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
5602
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5603
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5604
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5605
+ </xsl:choose>
5606
+ </xsl:attribute>
5607
+ </xsl:template><xsl:template name="number-to-words">
5608
+ <xsl:param name="number"/>
5609
+ <xsl:param name="first"/>
5610
+ <xsl:if test="$number != ''">
5611
+ <xsl:variable name="words">
5612
+ <words>
5613
+ <word cardinal="1">One-</word>
5614
+ <word ordinal="1">First </word>
5615
+ <word cardinal="2">Two-</word>
5616
+ <word ordinal="2">Second </word>
5617
+ <word cardinal="3">Three-</word>
5618
+ <word ordinal="3">Third </word>
5619
+ <word cardinal="4">Four-</word>
5620
+ <word ordinal="4">Fourth </word>
5621
+ <word cardinal="5">Five-</word>
5622
+ <word ordinal="5">Fifth </word>
5623
+ <word cardinal="6">Six-</word>
5624
+ <word ordinal="6">Sixth </word>
5625
+ <word cardinal="7">Seven-</word>
5626
+ <word ordinal="7">Seventh </word>
5627
+ <word cardinal="8">Eight-</word>
5628
+ <word ordinal="8">Eighth </word>
5629
+ <word cardinal="9">Nine-</word>
5630
+ <word ordinal="9">Ninth </word>
5631
+ <word ordinal="10">Tenth </word>
5632
+ <word ordinal="11">Eleventh </word>
5633
+ <word ordinal="12">Twelfth </word>
5634
+ <word ordinal="13">Thirteenth </word>
5635
+ <word ordinal="14">Fourteenth </word>
5636
+ <word ordinal="15">Fifteenth </word>
5637
+ <word ordinal="16">Sixteenth </word>
5638
+ <word ordinal="17">Seventeenth </word>
5639
+ <word ordinal="18">Eighteenth </word>
5640
+ <word ordinal="19">Nineteenth </word>
5641
+ <word cardinal="20">Twenty-</word>
5642
+ <word ordinal="20">Twentieth </word>
5643
+ <word cardinal="30">Thirty-</word>
5644
+ <word ordinal="30">Thirtieth </word>
5645
+ <word cardinal="40">Forty-</word>
5646
+ <word ordinal="40">Fortieth </word>
5647
+ <word cardinal="50">Fifty-</word>
5648
+ <word ordinal="50">Fiftieth </word>
5649
+ <word cardinal="60">Sixty-</word>
5650
+ <word ordinal="60">Sixtieth </word>
5651
+ <word cardinal="70">Seventy-</word>
5652
+ <word ordinal="70">Seventieth </word>
5653
+ <word cardinal="80">Eighty-</word>
5654
+ <word ordinal="80">Eightieth </word>
5655
+ <word cardinal="90">Ninety-</word>
5656
+ <word ordinal="90">Ninetieth </word>
5657
+ <word cardinal="100">Hundred-</word>
5658
+ <word ordinal="100">Hundredth </word>
5659
+ </words>
5660
+ </xsl:variable>
5661
+
5662
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
5663
+
5664
+ <xsl:variable name="value">
5665
+ <xsl:choose>
5666
+ <xsl:when test="$ordinal != ''">
5667
+ <xsl:value-of select="$ordinal"/>
5668
+ </xsl:when>
5669
+ <xsl:otherwise>
5670
+ <xsl:choose>
5671
+ <xsl:when test="$number &lt; 100">
5672
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
5673
+ <xsl:variable name="digit" select="substring($number,2)"/>
5674
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
5675
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
5676
+ </xsl:when>
5677
+ <xsl:otherwise>
5678
+ <!-- more 100 -->
5679
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
5680
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
5681
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
5682
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
5683
+ <xsl:call-template name="number-to-words">
5684
+ <xsl:with-param name="number" select="$digits"/>
5685
+ </xsl:call-template>
5686
+ </xsl:otherwise>
5687
+ </xsl:choose>
5688
+ </xsl:otherwise>
5689
+ </xsl:choose>
5690
+ </xsl:variable>
5691
+ <xsl:choose>
5692
+ <xsl:when test="$first = 'true'">
5693
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
5694
+ <xsl:call-template name="capitalize">
5695
+ <xsl:with-param name="str" select="$value_lc"/>
5696
+ </xsl:call-template>
5697
+ </xsl:when>
5698
+ <xsl:otherwise>
5699
+ <xsl:value-of select="$value"/>
5700
+ </xsl:otherwise>
5701
+ </xsl:choose>
5702
+ </xsl:if>
5192
5703
  </xsl:template></xsl:stylesheet>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.7.4".freeze
3
+ VERSION = "1.7.8".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -26,9 +26,9 @@ Gem::Specification.new do |spec|
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
29
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
30
30
 
31
- spec.add_dependency "metanorma-generic", "~> 1.10.0"
31
+ spec.add_dependency "metanorma-generic", "~> 1.10.2"
32
32
 
33
33
  spec.add_development_dependency "byebug", "~> 9.1"
34
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
4
+ version: 1.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.10.0
19
+ version: 1.10.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.10.0
26
+ version: 1.10.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -244,7 +244,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
244
244
  requirements:
245
245
  - - ">="
246
246
  - !ruby/object:Gem::Version
247
- version: 2.4.0
247
+ version: 2.5.0
248
248
  required_rubygems_version: !ruby/object:Gem::Requirement
249
249
  requirements:
250
250
  - - ">="